From 5ce2c04ea4dc9c319d83f4367d28f4cff3297893 Mon Sep 17 00:00:00 2001 From: Matt Penny Date: Mon, 6 Jul 2020 21:10:28 -0400 Subject: [PATCH] Fix 'Prize for the Reckless' spikes when switching game modes The spikes are removed if the game is in no death or time trial mode, however the removal is accomplished by modifying a static array. So if the player switches to no death or time trial mode and switches back to regular play, the spikes will no longer be present until the game is restarted. This simple fix writes the spikes back to the static array if the game is not in no death or time trial mode. Another option is to maintain 2 static arrays - one with the spikes and one without - but that is needlessly wasteful and prone to mistakes (one array updated but not the other). --- desktop_version/src/Spacestation2.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/desktop_version/src/Spacestation2.cpp b/desktop_version/src/Spacestation2.cpp index 1aed1434..927de263 100644 --- a/desktop_version/src/Spacestation2.cpp +++ b/desktop_version/src/Spacestation2.cpp @@ -2535,13 +2535,12 @@ const int* spacestation2class::loadlevel(int rx, int ry) 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, 492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492,492, }; - if(game.nodeathmode || game.intimetrial) + + //Remove spikes in modes where the player shouldn't kill themselves + int spikevalue = (game.nodeathmode || game.intimetrial) ? 0 : 9; + for (int i = 23; i < 23+14; i++) { - for (int i = 23; i < 23+14; i++) - { - //Remove spikes - contents[i + 8*40] = 0; - } + contents[i + 8*40] = spikevalue; } obj.platformtile = 747;