diff --git a/linkerscript b/linkerscript index 482671b5..149b0ad9 100644 --- a/linkerscript +++ b/linkerscript @@ -1,6 +1,7 @@ ENTRY(_start) gAISTable = 0x2000000; +gLevelUpProc = 0x20200ac; DAT_0203e0ac = 0x203e0ac; gStatScreen = 0x200310C; diff --git a/src/skill.c b/src/skill.c index 3fbf9f77..2ab8adc4 100644 --- a/src/skill.c +++ b/src/skill.c @@ -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()); @@ -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)