From ffa4b16376bf1f2f0c0c5479337b46c093ece6ca Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 2 Jul 2020 20:20:12 +0100 Subject: [PATCH] Deobfustate some NPC_MAX values --- src/BossLife.cpp | 4 ++-- src/NpcAct040.cpp | 4 ++-- src/NpcAct060.cpp | 4 ++-- src/NpcAct300.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/BossLife.cpp b/src/BossLife.cpp index 358ebade..e7b9ccc9 100644 --- a/src/BossLife.cpp +++ b/src/BossLife.cpp @@ -17,10 +17,10 @@ void InitBossLife(void) BOOL StartBossLife(int code_event) { int i = 0; - while (i < 0x200 && gNPC[i].code_event != code_event) + while (i < NPC_MAX && gNPC[i].code_event != code_event) ++i; - if (i == 0x200) + if (i == NPC_MAX) return FALSE; gBL.flag = TRUE; diff --git a/src/NpcAct040.cpp b/src/NpcAct040.cpp index 05ba33f5..ee664f88 100644 --- a/src/NpcAct040.cpp +++ b/src/NpcAct040.cpp @@ -274,11 +274,11 @@ void ActNpc042(NPCHAR *npc) npc->ym = 0; npc->act_no = 14; - for (n = 0; n < 0x200; ++n) + for (n = 0; n < NPC_MAX; ++n) if (gNPC[n].code_event == 501) break; - if (n == 0x200) + if (n == NPC_MAX) { npc->act_no = 0; break; diff --git a/src/NpcAct060.cpp b/src/NpcAct060.cpp index 0b7571a6..8417caed 100644 --- a/src/NpcAct060.cpp +++ b/src/NpcAct060.cpp @@ -831,11 +831,11 @@ void ActNpc066(NPCHAR *npc) { case 0: int a; - for (a = 0; a < 0x200; ++a) + for (a = 0; a < NPC_MAX; ++a) if (gNPC[a].code_event == 1000) break; - if (a == 0x200) + if (a == NPC_MAX) break; npc->tgt_x = gNPC[a].x; diff --git a/src/NpcAct300.cpp b/src/NpcAct300.cpp index 7e1fe5ae..61806687 100644 --- a/src/NpcAct300.cpp +++ b/src/NpcAct300.cpp @@ -145,7 +145,7 @@ void ActNpc302(NPCHAR *npc) if (npc->direct != 0) { - for (n = 0xAA; n < 0x200; ++n) + for (n = 0xAA; n < NPC_MAX; ++n) { if (gNPC[n].cond & 0x80 && gNPC[n].code_event == npc->direct) { @@ -154,7 +154,7 @@ void ActNpc302(NPCHAR *npc) } } - if (n == 0x200) + if (n == NPC_MAX) { npc->cond = 0; break;