Fix some errors when compiled with Visual Studio 6

Thanks to Mint for testing VS6. The compiler would complain about
the declaration of these variables being skipped by the switch's
labels. Pretty sure this is perfectly-legal C++98, but whatever.

...

Stupid old compilers.
This commit is contained in:
Clownacy 2019-10-17 00:47:25 +01:00
parent 764df530ad
commit a9265e8b45
2 changed files with 6 additions and 2 deletions

View file

@ -1949,6 +1949,8 @@ void ActNpc158(NPCHAR *npc)
// Monster X (defeated) // Monster X (defeated)
void ActNpc159(NPCHAR *npc) void ActNpc159(NPCHAR *npc)
{ {
int i;
RECT rect = {144, 128, 192, 200}; RECT rect = {144, 128, 192, 200};
switch (npc->act_no) switch (npc->act_no)
@ -1956,7 +1958,7 @@ void ActNpc159(NPCHAR *npc)
case 0: case 0:
npc->act_no = 1; npc->act_no = 1;
for (int i = 0; i < 8; ++i) for (i = 0; i < 8; ++i)
SetNpChar(4, npc->x + (Random(-16, 16) * 0x200), npc->y + (Random(-16, 16) * 0x200), Random(-341, 341), Random(-341, 341), 0, 0, 0x100); SetNpChar(4, npc->x + (Random(-16, 16) * 0x200), npc->y + (Random(-16, 16) * 0x200), Random(-341, 341), Random(-341, 341), 0, 0, 0x100);
// Fallthrough // Fallthrough
case 1: case 1:

View file

@ -970,6 +970,8 @@ void ActNpc189(NPCHAR *npc)
// Broken robot // Broken robot
void ActNpc190(NPCHAR *npc) void ActNpc190(NPCHAR *npc)
{ {
int i;
RECT rect[2] = { RECT rect[2] = {
{192, 32, 208, 48}, {192, 32, 208, 48},
{208, 32, 224, 48}, {208, 32, 224, 48},
@ -983,7 +985,7 @@ void ActNpc190(NPCHAR *npc)
case 10: case 10:
PlaySoundObject(72, 1); PlaySoundObject(72, 1);
for (int i = 0; i < 8; i++) for (i = 0; i < 8; i++)
SetNpChar(4, npc->x, npc->y + (Random(-8, 8) << 9), Random(-8, -2) << 9, Random(-3, 3) << 9, 0, 0, 0x100); SetNpChar(4, npc->x, npc->y + (Random(-8, 8) << 9), Random(-8, -2) << 9, Random(-3, 3) << 9, 0, 0, 0x100);
npc->cond = 0; npc->cond = 0;
break; break;