Note some bad code

This commit is contained in:
Clownacy 2019-02-27 21:56:16 +00:00
parent 54d9c0ad1a
commit 53b39cfa72
5 changed files with 10 additions and 4 deletions

View file

@ -204,7 +204,7 @@ void ActNpc104(NPCHAR *npc)
if (npc->act_wait > 18)
{
npc->act_no = 1;
npc->act_no = 1;
npc->act_no = 1; // Duplicate line
}
break;

View file

@ -94,7 +94,7 @@ void ActNpc140(NPCHAR *npc)
break;
case 10:
npc->bits = npc->bits;
npc->bits = npc->bits; // Redundant line
npc->act_no = 11;
npc->ani_no = 0;
npc->ani_wait = 0;
@ -838,7 +838,7 @@ void ActNpc147(NPCHAR *npc)
npc->act_no = 4;
npc->ani_no = 3;
npc->act_wait = 0;
npc->act_wait = 0;
npc->act_wait = 0; // Duplicate line
}
break;

View file

@ -1185,7 +1185,7 @@ void ActNpc193(NPCHAR *npc)
{
case 0:
npc->act_no = 1;
npc->y = npc->y;
npc->y = npc->y; // Redundant line
npc->x += 0x3000;
break;
}

View file

@ -1180,6 +1180,7 @@ void ActNpc268(NPCHAR *npc)
if (npc->ani_no > 1)
npc->ani_no = 0;
// This line makes absolutely no sense
if (npc->x < gMC.x + 0xE000 && npc->x > gMC.x - 0xE000 && npc->x < gMC.x + 0x6000 && npc->x > gMC.x - 0xE000)
npc->act_no = 10;

View file

@ -139,7 +139,12 @@ bool LoadProfile(char *name)
//Check header code
fread(profile.code, 8, 1, fp);
if (memcmp(profile.code, gProfileCode, 8))
{
#ifdef FIX_BUGS
fclose(fp); // The original game forgets to close the file
#endif
return false;
}
//Read data
fseek(fp, 0, SEEK_SET); //Pixel epic redundant code 😎😎😎