diff --git a/src/NpcAct100.cpp b/src/NpcAct100.cpp index 6c66d471..1806c76d 100644 --- a/src/NpcAct100.cpp +++ b/src/NpcAct100.cpp @@ -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; diff --git a/src/NpcAct140.cpp b/src/NpcAct140.cpp index 5992e1a9..cc506ccf 100644 --- a/src/NpcAct140.cpp +++ b/src/NpcAct140.cpp @@ -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; diff --git a/src/NpcAct180.cpp b/src/NpcAct180.cpp index 0ba63c30..71fb417a 100644 --- a/src/NpcAct180.cpp +++ b/src/NpcAct180.cpp @@ -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; } diff --git a/src/NpcAct260.cpp b/src/NpcAct260.cpp index 2f0f89bd..f8961879 100644 --- a/src/NpcAct260.cpp +++ b/src/NpcAct260.cpp @@ -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; diff --git a/src/Profile.cpp b/src/Profile.cpp index 826fef3c..597219da 100644 --- a/src/Profile.cpp +++ b/src/Profile.cpp @@ -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 😎😎😎