summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-03-04 22:26:43 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-03-04 22:26:43 -0500
commit379f1f8bd8da856a142deb5781c8e9ab15393452 (patch)
tree0e187f607127331880cf3a893542a1bf513477bc
parentdbc28c87fefbceb4eaec522b535f9034b05fe3f2 (diff)
downloadtanetane-379f1f8bd8da856a142deb5781c8e9ab15393452.tar.gz
tanetane-379f1f8bd8da856a142deb5781c8e9ab15393452.tar.bz2
tanetane-379f1f8bd8da856a142deb5781c8e9ab15393452.zip
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.
-rw-r--r--res/scripts/common.lua4
1 files changed, 2 insertions, 2 deletions
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)
296 local playerSprite = getSprite(playerId) 296 local playerSprite = getSprite(playerId)
297 local direction = playerSprite.dir 297 local direction = playerSprite.dir
298 298
299 playerSprite.controllable = false 299 DisablePlayerControl()
300 if (options & ChangeMapOptions.DO_NOT_FADE == 0) then 300 if (options & ChangeMapOptions.DO_NOT_FADE == 0) then
301 FadeToBlack(150) 301 FadeToBlack(150)
302 end 302 end
@@ -315,7 +315,7 @@ function ChangeMap(map, warp, options)
315 if (options & ChangeMapOptions.DO_NOT_FADE == 0) then 315 if (options & ChangeMapOptions.DO_NOT_FADE == 0) then
316 RemoveFadeout(150) 316 RemoveFadeout(150)
317 end 317 end
318 playerSprite.controllable = true 318 EnablePlayerControl()
319end 319end
320 320
321function CreateAnimatedSpriteAtPosition(alias, character, x, y, animName, direction, layer) 321function CreateAnimatedSpriteAtPosition(alias, character, x, y, animName, direction, layer)