diff options
author | Slawter666 <38655737+Slawter666@users.noreply.github.com> | 2018-07-08 01:23:28 +0100 |
---|---|---|
committer | Slawter666 <38655737+Slawter666@users.noreply.github.com> | 2018-07-08 01:23:28 +0100 |
commit | 08774bdd88e9c61fec790c7a92a3af78c66ba0c0 (patch) | |
tree | 7bc855529fc11e599cc40ceda9f114f86b9a6340 /src/rom6.c | |
parent | dd228fae5a4f0426c0242b3bb5ac6dfe62673a1f (diff) | |
parent | 6313f360d5006527549b142253e22374624129e9 (diff) |
Merge https://github.com/pret/pokeemerald into pokedex-doc
Diffstat (limited to 'src/rom6.c')
-rw-r--r-- | src/rom6.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/rom6.c b/src/rom6.c index cdc1064dd..78cbbe2de 100644 --- a/src/rom6.c +++ b/src/rom6.c @@ -27,16 +27,16 @@ static void hm2_dig(void); static void sub_8135780(void); // extern RAM loc -extern struct MapPosition gUnknown_0203AB40; +extern struct MapPosition gPlayerFacingPosition; // text -bool8 npc_before_player_of_type(u8 a) +bool8 CheckObjectGraphicsInFrontOfPlayer(u8 a) { u8 eventObjId; - GetXYCoordsOneStepInFrontOfPlayer(&gUnknown_0203AB40.x, &gUnknown_0203AB40.y); - gUnknown_0203AB40.height = PlayerGetZCoord(); - eventObjId = GetEventObjectIdByXYZ(gUnknown_0203AB40.x, gUnknown_0203AB40.y, gUnknown_0203AB40.height); + GetXYCoordsOneStepInFrontOfPlayer(&gPlayerFacingPosition.x, &gPlayerFacingPosition.y); + gPlayerFacingPosition.height = PlayerGetZCoord(); + eventObjId = GetEventObjectIdByXYZ(gPlayerFacingPosition.x, gPlayerFacingPosition.y, gPlayerFacingPosition.height); if (gEventObjects[eventObjId].graphicsId != a) { return FALSE; @@ -50,7 +50,7 @@ bool8 npc_before_player_of_type(u8 a) u8 oei_task_add(void) { - GetXYCoordsOneStepInFrontOfPlayer(&gUnknown_0203AB40.x, &gUnknown_0203AB40.y); + GetXYCoordsOneStepInFrontOfPlayer(&gPlayerFacingPosition.x, &gPlayerFacingPosition.y); return CreateTask(task08_080C9820, 8); } @@ -118,17 +118,17 @@ static void sub_813561C(u8 taskId) bool8 SetUpFieldMove_RockSmash(void) { - if(ShouldDoBrailleStrengthEffect()) + if (ShouldDoBrailleStrengthEffect()) { gSpecialVar_Result = GetCursorSelectionMonId(); - gUnknown_03005DB0 = FieldCallback_Teleport; - gUnknown_0203CEEC = sub_8179834; + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = sub_8179834; return TRUE; } - else if (npc_before_player_of_type(0x56) == TRUE) + else if (CheckObjectGraphicsInFrontOfPlayer(EVENT_OBJ_GFX_BREAKABLE_ROCK) == TRUE) { - gUnknown_03005DB0 = FieldCallback_Teleport; - gUnknown_0203CEEC = sub_81356C4; + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = sub_81356C4; return TRUE; } else @@ -164,8 +164,8 @@ bool8 SetUpFieldMove_Dig(void) { if (CanUseEscapeRopeOnCurrMap() == TRUE) { - gUnknown_03005DB0 = FieldCallback_Teleport; - gUnknown_0203CEEC = hm2_dig; + gFieldCallback2 = FieldCallback_PrepareFadeInFromMenu; + gPostMenuFieldCallback = hm2_dig; return TRUE; } else |