diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-04 22:26:43 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-03-04 22:26:43 -0500 |
commit | 379f1f8bd8da856a142deb5781c8e9ab15393452 (patch) | |
tree | 0e187f607127331880cf3a893542a1bf513477bc /res/scripts | |
parent | dbc28c87fefbceb4eaec522b535f9034b05fe3f2 (diff) | |
download | tanetane-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.
Diffstat (limited to 'res/scripts')
-rw-r--r-- | res/scripts/common.lua | 4 |
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() |
319 | end | 319 | end |
320 | 320 | ||
321 | function CreateAnimatedSpriteAtPosition(alias, character, x, y, animName, direction, layer) | 321 | function CreateAnimatedSpriteAtPosition(alias, character, x, y, animName, direction, layer) |