From 379f1f8bd8da856a142deb5781c8e9ab15393452 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Thu, 4 Mar 2021 22:26:43 -0500 Subject: Fixed player losing control on first entering hallucination_interior The issue was that the large number of sprites on the map causes the game sprite vector to resize itself during the map load, which invalidates all sprite object pointers, including the one to the player sprite that is used to give the player control again after a map change. --- res/scripts/common.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'res/scripts/common.lua') diff --git a/res/scripts/common.lua b/res/scripts/common.lua index eb3817e..36ccc46 100644 --- a/res/scripts/common.lua +++ b/res/scripts/common.lua @@ -296,7 +296,7 @@ function ChangeMap(map, warp, options) local playerSprite = getSprite(playerId) local direction = playerSprite.dir - playerSprite.controllable = false + DisablePlayerControl() if (options & ChangeMapOptions.DO_NOT_FADE == 0) then FadeToBlack(150) end @@ -315,7 +315,7 @@ function ChangeMap(map, warp, options) if (options & ChangeMapOptions.DO_NOT_FADE == 0) then RemoveFadeout(150) end - playerSprite.controllable = true + EnablePlayerControl() end function CreateAnimatedSpriteAtPosition(alias, character, x, y, animName, direction, layer) -- cgit 1.4.1