shithub: cstory

Download patch

ref: ffa4b16376bf1f2f0c0c5479337b46c093ece6ca
parent: f7b428752fce30cf49fb1d5b28154921931463d7
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Jul 2 16:20:12 EDT 2020

Deobfustate some NPC_MAX values

--- a/src/BossLife.cpp
+++ b/src/BossLife.cpp
@@ -17,10 +17,10 @@
 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;
--- a/src/NpcAct040.cpp
+++ b/src/NpcAct040.cpp
@@ -274,11 +274,11 @@
 			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;
--- a/src/NpcAct060.cpp
+++ b/src/NpcAct060.cpp
@@ -831,11 +831,11 @@
 	{
 		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;
--- a/src/NpcAct300.cpp
+++ b/src/NpcAct300.cpp
@@ -145,7 +145,7 @@
 
 			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 @@
 					}
 				}
 
-				if (n == 0x200)
+				if (n == NPC_MAX)
 				{
 					npc->cond = 0;
 					break;