diff --git a/src/g_game.cpp b/src/g_game.cpp index 119e99ee52..09732db195 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1410,7 +1410,7 @@ FPlayerStart *FLevelLocals::SelectFarthestDeathmatchSpot (size_t selections) if (distance > bestdistance) { bestdistance = distance; - bestspot = &level.deathmatchstarts[i]; + bestspot = &deathmatchstarts[i]; } } @@ -1425,7 +1425,7 @@ FPlayerStart *FLevelLocals::SelectRandomDeathmatchSpot (int playernum, unsigned for (j = 0; j < 20; j++) { i = pr_dmspawn() % selections; - if (CheckSpot (playernum, &level.deathmatchstarts[i]) ) + if (CheckSpot (playernum, &deathmatchstarts[i]) ) { return &deathmatchstarts[i]; } @@ -1526,7 +1526,7 @@ FPlayerStart *FLevelLocals::PickPlayerStart(int playernum, int flags) unsigned int i; // Find all unblocked player starts. - for (i = 0; i < level.AllPlayerStarts.Size(); ++i) + for (i = 0; i < AllPlayerStarts.Size(); ++i) { if (CheckSpot(playernum, &AllPlayerStarts[i])) { @@ -1539,7 +1539,7 @@ FPlayerStart *FLevelLocals::PickPlayerStart(int playernum, int flags) } } // Pick a spot at random, whether it's open or not. - return &level.AllPlayerStarts[pr_pspawn(AllPlayerStarts.Size())]; + return &AllPlayerStarts[pr_pspawn(AllPlayerStarts.Size())]; } return &playerstarts[playernum]; } @@ -1568,7 +1568,7 @@ DEFINE_ACTION_FUNCTION(FLevelLocals, PickPlayerStart) void FLevelLocals::QueueBody (AActor *body) { // flush an old corpse if needed - int modslot = bodyqueslot%level.BODYQUESIZE; + int modslot = bodyqueslot % BODYQUESIZE; bodyqueslot = modslot + 1; if (bodyqueslot >= BODYQUESIZE && bodyque[modslot] != NULL) @@ -1620,7 +1620,7 @@ void FLevelLocals::DoReborn (int playernum, bool freshbot) { // Reload the level from scratch bool indemo = demoplayback; BackupSaveName = ""; - G_InitNew (level.MapName, false); + G_InitNew (MapName, false); demoplayback = indemo; } } diff --git a/src/g_level.cpp b/src/g_level.cpp index 3a29c2098a..940708a806 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -141,7 +141,7 @@ CUSTOM_CVAR(Int, gl_lightmode, 3, CVAR_ARCHIVE | CVAR_NOINITCALL) if (self != newself) self = newself; else for (auto Level : AllLevels()) { - if ((level.info == nullptr || level.info->lightmode == ELightMode::NotSet)) level.lightMode = (ELightMode)*self; + if ((Level->info == nullptr || Level->info->lightmode == ELightMode::NotSet)) Level->lightMode = (ELightMode)*self; } } diff --git a/src/g_levellocals.h b/src/g_levellocals.h index aa19b989e5..30d915ccda 100644 --- a/src/g_levellocals.h +++ b/src/g_levellocals.h @@ -98,6 +98,8 @@ typedef TMap FDialogueMap; // maps actor class names to dialogue struct FLevelLocals { + void *level; + void *Level; // bug catchers. FLevelLocals() : Behaviors(this), tagManager(this) {} friend class MapLoader;