shithub: cstory

Download patch

ref: 809fb95b26db88269023e67b99b6ffb7585861d2
parent: e5caff593c599ab4b07df0df4183d8adc069f77b
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Feb 18 15:40:51 EST 2019

Fix Surface_Ids crash

--- a/src/NpChar.cpp
+++ b/src/NpChar.cpp
@@ -36,7 +36,7 @@
 void SetUniqueParameter(NPCHAR *npc)
 {
 	int code = npc->code_char;
-	npc->surf = gNpcTable[code].surf;
+	npc->surf = (Surface_Ids)gNpcTable[code].surf;
 	npc->hit_voice = gNpcTable[code].hit_voice;
 	npc->destroy_voice = gNpcTable[code].destroy_voice;
 	npc->damage = gNpcTable[code].damage;
@@ -348,7 +348,7 @@
 				(gNPC[n].x - side) / 0x200 - fx / 0x200 + a,
 				(gNPC[n].y - gNPC[n].view.top) / 0x200 - fy / 0x200,
 				&gNPC[n].rect,
-				gNPC[n].surf);
+				(Surface_Ids)gNPC[n].surf);
 		}
 	}
 }
--- a/src/NpcTbl.h
+++ b/src/NpcTbl.h
@@ -15,7 +15,7 @@
 {
 	uint16_t bits;
 	uint16_t life;
-	Surface_Ids surf;
+	uint8_t surf;
 	uint8_t hit_voice;
 	uint8_t destroy_voice;
 	uint8_t size;