shithub: cstory

Download patch

ref: 372872eeea3fff1f1f648ea7f00c809a3d1820ce
parent: 38a00ec88a41f3f12edce32753933eac78cb7a20
author: Gabriel Ravier <gabravier@gmail.com>
date: Tue Sep 17 07:54:00 EDT 2019

Some comments and a FIX_BUGS

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>

--- a/src/ArmsItem.cpp
+++ b/src/ArmsItem.cpp
@@ -27,6 +27,9 @@
 
 void ClearArmsData()
 {
+#ifdef FIX_BUGS
+	gSelectedArms = 0; // Should probably be done in order to avoid potential problems
+#endif
 	gArmsEnergyX = 0x20;
 	memset(gArmsData, 0, sizeof(gArmsData));
 }
@@ -149,10 +152,10 @@
 	int i;
 	for (i = 0; i < ITEM_MAX; ++i)
 		if (gItemData[i].code == code)
-			break;
+			break; // Found
 
 	if (i == ITEM_MAX)
-		return FALSE;
+		return FALSE; // Not found
 
 	// Shift all items from the right to the left
 	for (++i; i < ITEM_MAX; ++i)
@@ -164,6 +167,7 @@
 	return TRUE;
 }
 
+/// Handle the moving
 static void MoveCampCursor()
 {
 	int arms_num = 0;
--- a/src/ArmsItem.h
+++ b/src/ArmsItem.h
@@ -44,10 +44,10 @@
 extern ITEM gItemData[ITEM_MAX];
 
 
-/// Clear the weapons array, reverting it to the default state (no weapons)
+/// Clear the weapons array, reverting it to the default state (no weapons) and adjust variables (initialize weapons basically)
 void ClearArmsData();
 
-/// Clear the item array, reverting it to the default state (no items)
+/// Clear the item array, reverting it to the default state (no items) (initialize items basically)
 void ClearItemData();