- refactored the global sectors array into a more VM friendly type and moved it into FLevelLocals.

This commit is contained in:
Christoph Oelckers 2017-01-07 19:32:24 +01:00
commit c02281a439
57 changed files with 438 additions and 456 deletions

View file

@ -1189,12 +1189,12 @@ static void PrintSecretString(const char *string, bool thislevel)
{
if (string[1] == 'S' || string[1] == 's')
{
long secnum = strtol(string+2, (char**)&string, 10);
auto secnum = strtoul(string+2, (char**)&string, 10);
if (*string == ';') string++;
if (thislevel && secnum >= 0 && secnum < numsectors)
if (thislevel && secnum < level.sectors.Size())
{
if (sectors[secnum].isSecret()) colstr = TEXTCOLOR_RED;
else if (sectors[secnum].wasSecret()) colstr = TEXTCOLOR_GREEN;
if (level.sectors[secnum].isSecret()) colstr = TEXTCOLOR_RED;
else if (level.sectors[secnum].wasSecret()) colstr = TEXTCOLOR_GREEN;
else colstr = TEXTCOLOR_ORANGE;
}
}