- redirect most references to the global players array through FLevelLocals.

The Map loader may not access any global state at all - everything it can touch must be exchangable.
Furthermore, if we want to sandbox each level, there may be no direct access to any kind of global state whatsoever from the play code.
This commit is contained in:
Christoph Oelckers 2019-01-30 01:15:32 +01:00
commit 8bbdee5c28
19 changed files with 259 additions and 189 deletions

View file

@ -3247,8 +3247,8 @@ void MapLoader::LoadLevel(MapData *map, const char *lumpname, int position)
for (int i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i] && players[i].mo != nullptr)
players[i].health = players[i].mo->health;
if (Level->PlayerInGame(i) && Level->Players[i]->mo != nullptr)
Level->Players[i]->health = Level->Players[i]->mo->health;
}
if (!map->HasBehavior && !map->isText)
TranslateTeleportThings(); // [RH] Assign teleport destination TIDs