summaryrefslogtreecommitdiff
path: root/src/scrcmd.c
diff options
context:
space:
mode:
authorfroggestspirit <froggestspirit@gmail.com>2021-09-06 10:32:14 -0400
committerfroggestspirit <froggestspirit@gmail.com>2021-09-06 10:32:14 -0400
commit73554ec88d4f269b6146f6d1ab5d2742cb0a6f89 (patch)
treefac5bee8a4ce4757816dbbe42265523478b78781 /src/scrcmd.c
parentec6b1ea3735ff98a9714b219e4a999894ecc6010 (diff)
parent63e6b914e4d9b9bdb0a8d621b2ed233990f2ef66 (diff)
Merge remote-tracking branch 'pret/master'
Diffstat (limited to 'src/scrcmd.c')
-rw-r--r--src/scrcmd.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/scrcmd.c b/src/scrcmd.c
index 7dc02b6a8..f53483978 100644
--- a/src/scrcmd.c
+++ b/src/scrcmd.c
@@ -1203,6 +1203,8 @@ bool8 ScrCmd_turnvobject(struct ScriptContext *ctx)
return FALSE;
}
+// lockall freezes all object events except the player immediately.
+// The player is frozen after waiting for their current movement to finish.
bool8 ScrCmd_lockall(struct ScriptContext *ctx)
{
if (IsUpdateLinkStateCBActive())
@@ -1211,12 +1213,14 @@ bool8 ScrCmd_lockall(struct ScriptContext *ctx)
}
else
{
- ScriptFreezeObjectEvents();
+ FreezeObjects_WaitForPlayer();
SetupNativeScript(ctx, IsFreezePlayerFinished);
return TRUE;
}
}
+// lock freezes all object events except the player and the selected object immediately.
+// The player and selected object are frozen after waiting for their current movement to finish.
bool8 ScrCmd_lock(struct ScriptContext *ctx)
{
if (IsUpdateLinkStateCBActive())
@@ -1227,12 +1231,12 @@ bool8 ScrCmd_lock(struct ScriptContext *ctx)
{
if (gObjectEvents[gSelectedObjectEvent].active)
{
- LockSelectedObjectEvent();
+ FreezeObjects_WaitForPlayerAndSelected();
SetupNativeScript(ctx, IsFreezeSelectedObjectAndPlayerFinished);
}
else
{
- ScriptFreezeObjectEvents();
+ FreezeObjects_WaitForPlayer();
SetupNativeScript(ctx, IsFreezePlayerFinished);
}
return TRUE;
@@ -1466,15 +1470,15 @@ bool8 ScrCmd_hidemonpic(struct ScriptContext *ctx)
return TRUE;
}
-bool8 ScrCmd_showcontestwinner(struct ScriptContext *ctx)
+bool8 ScrCmd_showcontestpainting(struct ScriptContext *ctx)
{
u8 contestWinnerId = ScriptReadByte(ctx);
- // Don't save artist's painting yet
+ // Artist's painting is temporary and already has its data loaded
if (contestWinnerId != CONTEST_WINNER_ARTIST)
SetContestWinnerForPainting(contestWinnerId);
- ShowContestWinnerPainting();
+ ShowContestPainting();
ScriptContext1_Stop();
return TRUE;
}