shithub: cstory

Download patch

ref: 24b36ccda8e33dd7520040bd8b3a95c1067cf873
parent: f0273ecf3f0df7f8b9ee232de87af3cb789c699c
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Jan 7 01:57:03 EST 2020

More-accurate MycHit.cpp variable arrangement

--- a/src/MycHit.cpp
+++ b/src/MycHit.cpp
@@ -409,10 +409,12 @@
 
 void HitMyCharMap(void)
 {
+	int x, y;
 	int i;
+	unsigned char atrb[4];
 
-	int x = gMC.x / 0x10 / 0x200;
-	int y = gMC.y / 0x10 / 0x200;
+	x = gMC.x / 0x10 / 0x200;
+	y = gMC.y / 0x10 / 0x200;
 
 	int offx[4];
 	int offy[4];
@@ -427,7 +429,6 @@
 	offy[2] = 1;
 	offy[3] = 1;
 
-	unsigned char atrb[4];
 	for (i = 0; i < 4; ++i)
 	{
 		atrb[i] = GetAttribute(x + offx[i], y + offy[i]);
@@ -666,13 +667,13 @@
 int JudgeHitMyCharNPC4(NPCHAR *npc)
 {
 	// TODO: comment this
+	int hit = 0;
+
+	float fy1;
 	float fx1;
 	float fx2;
-	float fy1;
 	float fy2;
 
-	int hit = 0;
-
 	if (npc->x > gMC.x)
 		fx1 = (float)(npc->x - gMC.x);
 	else
@@ -768,7 +769,6 @@
 void HitMyCharNpChar(void)
 {
 	int i;
-
 	int hit = 0;
 
 	if (!(gMC.cond & 0x80) || gMC.cond & 2)
@@ -859,7 +859,6 @@
 void HitMyCharBoss(void)
 {
 	int b;
-
 	int hit = 0;
 
 	if (!(gMC.cond & 0x80) || gMC.cond & 2)