Visual Studio won't compile 1.61
case SITE_EVIL_SUPERVILLAIN:
(767) static int lairs_initialized = 0;
static int lairlist[8];
if (!lairs_initialized)
{
lairs_initialized = 1;
for (int i = 0; i < 8; i++)
lairlist[i] = 0;
}
for (;;)
{
nextlair = LCSrandom(8);
if (!lairlist[nextlair])
{
lairlist[nextlair] = 1;
switch (LCSrandom(8))
{
case 0: strcpy(loc.name, "Underground Mausoleum"); strcpy(loc.shortname, "Tomb"); break;
case 1: strcpy(loc.name, "Spacious Sewer"); strcpy(loc.shortname, "Sewer"); break;
case 2: strcpy(loc.name, "Mysterious Cave Complex"); strcpy(loc.shortname, "Cave"); break;
case 3: strcpy(loc.name, "Secret Laboratory"); strcpy(loc.shortname, "SecLab"); break;
case 4: strcpy(loc.name, "Ominous Castle"); strcpy(loc.shortname, "Castle"); break;
case 5: strcpy(loc.name, "Forgotten Temple"); strcpy(loc.shortname, "Temple"); break;
case 6: strcpy(loc.name, "Space Rift"); strcpy(loc.shortname, "Rift"); break;
case 7: strcpy(loc.name, "Black Skyscraper"); strcpy(loc.shortname, "Skyscraper"); break;
}
break;
}
}
break;
(800) case SITE_MEDIA_MOVIES:
...
src\locations\locations.cpp(800): error C2360: initialization of 'lairs_initialized' is skipped by 'case' label
src\locations\locations.cpp(767): note: see declaration of 'lairs_initialized'
Visual Studio doesn't allow variables to be declared and initialized within a case statement.