mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-10-01 22:09:43 -05:00
Name HasTwoAliveMons, standardize multiline conditionals
This commit is contained in:
@@ -13,7 +13,7 @@ int sub_020549A0(Party * param0, u16 param1);
|
||||
int sub_02054A10(const Party * param0);
|
||||
Pokemon * Party_FirstBattler(const Party * param0);
|
||||
Pokemon * sub_02054A74(const Party * param0);
|
||||
BOOL sub_02054AB0(const Party * param0);
|
||||
BOOL Party_HasTwoAliveMons(const Party *party);
|
||||
void sub_02054AC4(Party * param0);
|
||||
int sub_02054B04(Party * param0, u16 param1);
|
||||
BOOL sub_02054B94(Pokemon * param0);
|
||||
|
||||
@@ -161,10 +161,10 @@ void FieldInput_Update (FieldInput *input, FieldSystem *fieldSystem, u16 pressed
|
||||
input->endMovement = TRUE;
|
||||
}
|
||||
|
||||
if (playerDir == DIR_NORTH && heldKeys & PAD_KEY_UP ||
|
||||
playerDir == DIR_SOUTH && heldKeys & PAD_KEY_DOWN ||
|
||||
playerDir == DIR_WEST && heldKeys & PAD_KEY_LEFT ||
|
||||
playerDir == DIR_EAST && heldKeys & PAD_KEY_RIGHT) {
|
||||
if (playerDir == DIR_NORTH && heldKeys & PAD_KEY_UP
|
||||
|| playerDir == DIR_SOUTH && heldKeys & PAD_KEY_DOWN
|
||||
|| playerDir == DIR_WEST && heldKeys & PAD_KEY_LEFT
|
||||
|| playerDir == DIR_EAST && heldKeys & PAD_KEY_RIGHT) {
|
||||
|
||||
input->transitionDir = playerDir;
|
||||
} else {
|
||||
@@ -181,15 +181,15 @@ BOOL FieldInput_Process (const FieldInput *input, FieldSystem *fieldSystem)
|
||||
}
|
||||
|
||||
if (input->unused5 == FALSE) {
|
||||
BOOL doublesCheck = sub_02054AB0(Party_GetFromSavedata(fieldSystem->saveData));
|
||||
BOOL hasTwoAliveMons = Party_HasTwoAliveMons(Party_GetFromSavedata(fieldSystem->saveData));
|
||||
|
||||
if (sub_0206A984(SaveData_Events(fieldSystem->saveData)) == TRUE) {
|
||||
doublesCheck = TRUE;
|
||||
hasTwoAliveMons = TRUE;
|
||||
}
|
||||
|
||||
if (sub_02067A84(fieldSystem, doublesCheck) == TRUE ||
|
||||
sub_02071CB4(fieldSystem, 2) == TRUE &&
|
||||
ov8_0224C51C(fieldSystem) == TRUE) {
|
||||
if (sub_02067A84(fieldSystem, hasTwoAliveMons) == TRUE
|
||||
|| sub_02071CB4(fieldSystem, 2) == TRUE
|
||||
&& ov8_0224C51C(fieldSystem) == TRUE) {
|
||||
|
||||
sub_0205F56C(fieldSystem->playerAvatar);
|
||||
MapObjectMan_PauseAllMovement(fieldSystem->mapObjMan);
|
||||
@@ -248,9 +248,9 @@ BOOL FieldInput_Process (const FieldInput *input, FieldSystem *fieldSystem)
|
||||
}
|
||||
}
|
||||
|
||||
if (input->sign &&
|
||||
PlayerAvatar_GetDir(fieldSystem->playerAvatar) == input->playerDir &&
|
||||
Field_CheckSign(fieldSystem) == TRUE) {
|
||||
if (input->sign
|
||||
&& PlayerAvatar_GetDir(fieldSystem->playerAvatar) == input->playerDir
|
||||
&& Field_CheckSign(fieldSystem) == TRUE) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -391,9 +391,9 @@ BOOL FieldInput_Process_Underground (FieldInput *input, FieldSystem *fieldSystem
|
||||
|
||||
BOOL FieldInput_Process_Colosseum (FieldInput *input, FieldSystem *fieldSystem)
|
||||
{
|
||||
if (input->mapTransition &&
|
||||
input->transitionDir == DIR_SOUTH &&
|
||||
sub_0205DB1C(Field_CurrentTileBehavior(fieldSystem))) {
|
||||
if (input->mapTransition
|
||||
&& input->transitionDir == DIR_SOUTH
|
||||
&& sub_0205DB1C(Field_CurrentTileBehavior(fieldSystem))) {
|
||||
|
||||
sub_0203E880(fieldSystem, 9101, NULL);
|
||||
return TRUE;
|
||||
@@ -884,6 +884,7 @@ static BOOL Field_UpdateFriendship (FieldSystem *fieldSystem)
|
||||
|
||||
static void Field_CalculateFriendship (FieldSystem *fieldSystem)
|
||||
{
|
||||
// C99-style declarations don't match
|
||||
int i, partyCount;
|
||||
Party *party = Party_GetFromSavedata(fieldSystem->saveData);
|
||||
u16 mapID = MapHeader_GetMapLabelTextID(fieldSystem->unk_1C->unk_00);
|
||||
@@ -1057,9 +1058,9 @@ static void Field_TrySetMapConnection (FieldSystem *fieldSystem)
|
||||
} else {
|
||||
Field_Step(fieldSystem, &playerX, &playerZ);
|
||||
|
||||
if (Field_MapConnection(fieldSystem, playerX, playerZ, &nextMap) &&
|
||||
MapHeader_IsOnMainMatrix(fieldSystem->unk_1C->unk_00) == TRUE &&
|
||||
MapHeader_IsOnMainMatrix(nextMap.unk_00) == FALSE) {
|
||||
if (Field_MapConnection(fieldSystem, playerX, playerZ, &nextMap)
|
||||
&& MapHeader_IsOnMainMatrix(fieldSystem->unk_1C->unk_00) == TRUE
|
||||
&& MapHeader_IsOnMainMatrix(nextMap.unk_00) == FALSE) {
|
||||
|
||||
Field_SetMapConnection(fieldSystem, playerX, playerZ, PlayerAvatar_GetDir(fieldSystem->playerAvatar));
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ BOOL ScrCmd_0EE (ScriptContext * param0)
|
||||
{
|
||||
u16 * v0 = ScriptContext_GetVarPointer(param0);
|
||||
|
||||
*v0 = sub_02054AB0(Party_GetFromSavedata(param0->fieldSystem->saveData));
|
||||
*v0 = Party_HasTwoAliveMons(Party_GetFromSavedata(param0->fieldSystem->saveData));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,12 +159,12 @@ Pokemon * sub_02054A74 (const Party * param0)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BOOL sub_02054AB0 (const Party * param0)
|
||||
BOOL Party_HasTwoAliveMons (const Party *party)
|
||||
{
|
||||
if (sub_02054A10(param0) >= 2) {
|
||||
return 1;
|
||||
if (sub_02054A10(party) >= 2) {
|
||||
return TRUE;
|
||||
} else {
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user