From 843ddc684e380d9360e96ef4428f2426609bcb5e Mon Sep 17 00:00:00 2001 From: Daniel Monteiro Date: Sun, 16 Jun 2024 22:52:55 +0100 Subject: [PATCH] [MY] Fix elevator positioning when going up or down Fixes https://github.com/TheFakeMontyOnTheRun/space-trashman-blues/issues/154 --- core/src/Core.c | 10 +++++++--- my_frontend/src/Crawler.c | 6 ++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/core/src/Core.c b/core/src/Core.c index f94b0dd1d..5f88c23d6 100644 --- a/core/src/Core.c +++ b/core/src/Core.c @@ -356,10 +356,14 @@ void moveBy(uint8_t direction) { playerLocation = room->connections[direction]; room = &rooms[playerLocation]; - for (c = 0; c < 6; ++c) { - if (room->connections[c] == previousLocation) { - direction = c; + if (direction < 4) { + for (c = 0; c < 6; ++c) { + if (room->connections[c] == previousLocation) { + direction = c; + } } + } else { + return; } switch (direction) { diff --git a/my_frontend/src/Crawler.c b/my_frontend/src/Crawler.c index c5a6c42be..a239e3162 100644 --- a/my_frontend/src/Crawler.c +++ b/my_frontend/src/Crawler.c @@ -119,6 +119,12 @@ enum EGameMenuState Crawler_tickCallback(enum ECommand cmd, void* data) { case kCommandFire3: pickItem(); + + if (playerLocation != previousLocation) { + redrawMap = needsToRedrawHUD = needsToRedrawVisibleMeshes = 1; + initMap(); + } + break; case kCommandFire4: