- hotfixing some Exhumed map transition issues.

This avoids crashing on LEV20, but the whole thing is simply too poorly implemented to actually work - this needs to be redone so that the map transition does not occur in the middle of the game ticker.
This commit is contained in:
Christoph Oelckers 2020-08-30 21:45:21 +02:00
parent 511cb51e7f
commit ba8dc788fe
3 changed files with 6 additions and 8 deletions

View file

@ -117,7 +117,7 @@ static void GameDisplay(void)
drawtime.Reset(); drawtime.Reset();
drawtime.Clock(); drawtime.Clock();
if (currentLevel->levelNumber == kMap20) if (currentLevel && currentLevel->levelNumber == kMap20)
{ {
DoEnergyTile(); DoEnergyTile();
DrawClock(); DrawClock();
@ -191,6 +191,7 @@ void CheckProgression()
// start a new game on the given level // start a new game on the given level
currentLevel = nullptr; currentLevel = nullptr;
mylevelnew = GameAction; mylevelnew = GameAction;
currentLevel = FindMapByLevelNum(mylevelnew);
GameAction = -1; GameAction = -1;
InitNewGame(); InitNewGame();
if (mylevelnew > 0) STAT_StartNewGame("Exhumed", 1); if (mylevelnew > 0) STAT_StartNewGame("Exhumed", 1);

View file

@ -77,7 +77,7 @@ uint8_t LoadLevel(int nMap)
initspritelists(); initspritelists();
currentLevel = &mapList[nMap]; currentLevel = FindMapByLevelNum(nMap);
// init stuff // init stuff
{ {

View file

@ -79,13 +79,10 @@ static int osdcmd_map(CCmdFuncPtr parm)
} }
// Check if the map is already defined. // Check if the map is already defined.
for (int i = 0; i <= ISDEMOVER? 4 : 32; i++) auto map = FindMapByName(mapname);
if (map)
{ {
if (mapList[i].labelName.CompareNoCase(mapname) == 0) GameAction = map->levelNumber;
{
GameAction = i;
return CCMD_OK;
}
} }
return CCMD_OK; return CCMD_OK;
} }