Fixed follower/level script bug

After finishing a script that triggers upon loading a map, followers will no longer act as if they're exiting a door when the player takes their first step, assuming the follower was moved at all during said script.
This commit is contained in:
W1serV1ser committed 2023-03-31 15:52:20 -07:00
1 parent ee9875e185
commit 2d639a01fa
1 file changed
+9
+9
View File
@@ -1,4 +1,5 @@
#include "global.h"
#include "event_data.h"
#include "script_movement.h"
#include "event_object_movement.h"
#include "task.h"
@@ -26,6 +27,14 @@ bool8 ScriptMovement_StartObjectMovementScript(u8 localId, u8 mapNum, u8 mapGrou
return TRUE;
if (!FuncIsActiveTask(ScriptMovement_MoveObjects))
ScriptMovement_StartMoveObjects(50);
if (gSaveBlock2Ptr->follower.inProgress && objEventId == gSaveBlock2Ptr->follower.objId)
{
gSaveBlock2Ptr->follower.comeOutDoorStairs = 0;
gSaveBlock2Ptr->follower.warpEnd = 0;
#if FAST_FOLLOWERS == TRUE
FlagClear(FLAG_FOLLOWER_IN_BUILDING);
#endif
}
return ScriptMovement_TryAddNewMovement(GetMoveObjectsTaskId(), objEventId, movementScript);
}