Skip to content

Commit

Permalink
refactor: rename fleeing vars for dx parity
Browse files Browse the repository at this point in the history
  • Loading branch information
icebound777 committed Nov 8, 2024
1 parent a88c2e3 commit e1d02e3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/npc.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ typedef struct EncounterStatus {
/* 0x00D */ char unk_0D;
/* 0x00E */ s16 coinsEarned; /* valid after battle */
/* 0x010 */ s8 instigatorValue;
/* 0x011 */ s8 disallowFleeing;
/* 0x011 */ s8 forbidFleeing;
/* 0x012 */ s8 scriptedBattle; ///< battle started by StartBattle but not by encounter
/* 0x013 */ s8 dropWhackaBump;
/* 0x014 */ s32 songID;
Expand Down
2 changes: 1 addition & 1 deletion src/battle/btl_states_actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void btl_state_update_normal_start(void) {
battleStatus->unk_98 = 0;
battleStatus->hpDrainCount = 0;
gBattleStatus.flags2 |= BS_FLAGS2_CAN_FLEE;
if (currentEncounter->disallowFleeing) {
if (currentEncounter->forbidFleeing) {
gBattleStatus.flags2 &= ~BS_FLAGS2_CAN_FLEE;
}
battleStatus->endBattleFadeOutRate = 10;
Expand Down
2 changes: 1 addition & 1 deletion src/encounter.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ void update_encounters_neutral(void) {
currentEncounter->songID = -1;
currentEncounter->unk_18 = -1;
currentEncounter->hitType = 0;
currentEncounter->disallowFleeing = FALSE;
currentEncounter->forbidFleeing = FALSE;
currentEncounter->dropWhackaBump = FALSE;
currentEncounter->flags &= ~ENCOUNTER_FLAG_THUMBS_UP;
currentEncounter->flags &= ~ENCOUNTER_FLAG_CANT_SKIP_WIN_DELAY;
Expand Down
6 changes: 3 additions & 3 deletions src/encounter_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ void start_battle(Evt* script, s32 songID) {
currentEncounter->curEnemy = enemy;
currentEncounter->curEncounter = currentEncounter->encounterList[enemy->encounterIndex];
currentEncounter->firstStrikeType = FIRST_STRIKE_NONE;
currentEncounter->disallowFleeing = FALSE;
currentEncounter->forbidFleeing = FALSE;
currentEncounter->songID = songID;
currentEncounter->unk_18 = -1;

Expand Down Expand Up @@ -277,7 +277,7 @@ API_CALLABLE(StartBossBattle) {
currentEncounter->curEnemy = enemy;
currentEncounter->curEncounter = currentEncounter->encounterList[enemy->encounterIndex];
currentEncounter->firstStrikeType = FIRST_STRIKE_NONE;
currentEncounter->disallowFleeing = TRUE;
currentEncounter->forbidFleeing = TRUE;
currentEncounter->songID = songID;
currentEncounter->unk_18 = -1;

Expand Down Expand Up @@ -326,7 +326,7 @@ API_CALLABLE(SetBattleMusic) {
Bytecode songID = evt_get_variable(script, *args++);
EncounterStatus* currentEncounter = &gCurrentEncounter;

currentEncounter->disallowFleeing = TRUE;
currentEncounter->forbidFleeing = TRUE;
currentEncounter->songID = songID;
currentEncounter->unk_18 = -1;
return ApiStatus_DONE2;
Expand Down

0 comments on commit e1d02e3

Please sign in to comment.