Skip to content
This repository has been archived by the owner on Sep 26, 2024. It is now read-only.

Commit

Permalink
Bugfix: passive skill unlocked popup only shows when level up.
Browse files Browse the repository at this point in the history
  • Loading branch information
laqieer committed Apr 21, 2020
1 parent 5446d4f commit ad6725a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
1 change: 1 addition & 0 deletions linkerscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ENTRY(_start)

gAISTable = 0x2000000;
gLevelUpProc = 0x20200ac;
DAT_0203e0ac = 0x203e0ac;

gStatScreen = 0x200310C;
Expand Down
22 changes: 21 additions & 1 deletion src/skill.c
Original file line number Diff line number Diff line change
Expand Up @@ -4736,6 +4736,21 @@ struct Unit *getUnitByAIS(void *AIS)
return unitAtLeft;
}

struct Unit *getUnitBySideAndNumber(int side, int number)
{
switch(side)
{
case PlayerSide:
return &playerUnits[number];
case EnemySide:
return &enemyUnits[number];
case NPCSide:
return &NPCUnits[number];
default:
return &P4Units[number];
}
}

struct Unit *getUnitByCurrentAIS()
{
return getUnitByAIS(getCurrentAIS());
Expand Down Expand Up @@ -4790,10 +4805,15 @@ char *getNewUnlockedPassiveSkillNameTextByCurrentAIS()
return getNewUnlockedPassiveSkillNameText(getUnitByCurrentAIS());
}

extern struct Proc *gLevelUpProc;

void newPopupPassiveSkillUnlocked(struct Proc *proc, struct Unit *unit)
{
if(getNewUnlockedPassiveSkillNameText(unit))
if(gLevelUpProc != NULL && getNewUnlockedPassiveSkillNameText(unit))
{
newPopup(gPopupPassiveSkillUnlocked, 0x60, 0, proc);
gLevelUpProc = NULL;
}
}

void newPopupPassiveSkillUnlockedWhenLevelUp(struct Proc *proc)
Expand Down

0 comments on commit ad6725a

Please sign in to comment.