1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

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).
This commit is contained in:
Matt Penny 2020-07-06 21:10:28 -04:00 committed by Ethan Lee
parent e6f3dab2e1
commit 5ce2c04ea4

View file

@ -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;