summaryrefslogtreecommitdiff
path: root/src/scrcmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scrcmd.c')
-rw-r--r--src/scrcmd.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/scrcmd.c b/src/scrcmd.c
index 39df1117d..dd14c1eef 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -49,6 +49,7 @@
#include "trainer_see.h"
#include "tv.h"
#include "window.h"
+#include "constants/event_objects.h"
typedef u16 (*SpecialFunc)(void);
typedef void (*NativeFunc)(void);
@@ -748,7 +749,7 @@ bool8 ScrCmd_warp(struct ScriptContext *ctx)
u16 y = VarGet(ScriptReadHalfword(ctx));
SetWarpDestination(mapGroup, mapNum, warpId, x, y);
- sub_80AF734();
+ DoWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -762,7 +763,7 @@ bool8 ScrCmd_warpsilent(struct ScriptContext *ctx)
u16 y = VarGet(ScriptReadHalfword(ctx));
SetWarpDestination(mapGroup, mapNum, warpId, x, y);
- sp13E_warp_to_last_warp();
+ DoDiveWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -776,7 +777,7 @@ bool8 ScrCmd_warpdoor(struct ScriptContext *ctx)
u16 y = VarGet(ScriptReadHalfword(ctx));
SetWarpDestination(mapGroup, mapNum, warpId, x, y);
- sub_80AF7D0();
+ DoDoorWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -793,7 +794,7 @@ bool8 ScrCmd_warphole(struct ScriptContext *ctx)
SetWarpDestinationToFixedHoleWarp(x - 7, y - 7);
else
SetWarpDestination(mapGroup, mapNum, -1, x - 7, y - 7);
- sp13F_fall_to_last_warp();
+ DoFallWarp();
ResetInitialPlayerAvatarState();
return TRUE;
}
@@ -1239,11 +1240,11 @@ bool8 ScrCmd_lock(struct ScriptContext *ctx)
bool8 ScrCmd_releaseall(struct ScriptContext *ctx)
{
- u8 objectId;
+ u8 playerObjectId;
HideFieldMessageBox();
- objectId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
- EventObjectClearHeldMovementIfFinished(&gEventObjects[objectId]);
+ playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
+ EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
UnfreezeEventObjects();
return FALSE;
@@ -1251,13 +1252,13 @@ bool8 ScrCmd_releaseall(struct ScriptContext *ctx)
bool8 ScrCmd_release(struct ScriptContext *ctx)
{
- u8 objectId;
+ u8 playerObjectId;
HideFieldMessageBox();
if (gEventObjects[gSelectedEventObject].active)
EventObjectClearHeldMovementIfFinished(&gEventObjects[gSelectedEventObject]);
- objectId = GetEventObjectIdByLocalIdAndMap(0xFF, 0, 0);
- EventObjectClearHeldMovementIfFinished(&gEventObjects[objectId]);
+ playerObjectId = GetEventObjectIdByLocalIdAndMap(EVENT_OBJ_ID_PLAYER, 0, 0);
+ EventObjectClearHeldMovementIfFinished(&gEventObjects[playerObjectId]);
sub_80D338C();
UnfreezeEventObjects();
return FALSE;