shithub: cstory

Download patch

ref: 9d8018e901e1380042c26ce30697c64c0b6087ad
parent: eb46198635fde10abd14ec48b5241fe97ff38c94
author: Gabriel Ravier <gabravier@gmail.com>
date: Mon Sep 23 03:28:48 EDT 2019

More comments in ArmsItem

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

--- a/src/ArmsItem.cpp
+++ b/src/ArmsItem.cpp
@@ -203,6 +203,7 @@
 
 		if (gKeyTrg & (gKeyUp | gKeyDown))
 		{
+			// If there are any items, we're changing to the items section, since the weapons section has only 1 row
 			if (item_num)
 				gCampActive = TRUE;
 
@@ -209,7 +210,7 @@
 			bChange = TRUE;
 		}
 
-
+		// Loop around gSelectedArms if needed
 		if (gSelectedArms < 0)
 			gSelectedArms = arms_num - 1;
 
@@ -513,17 +514,17 @@
 {
 	for (int i = 0; i < ARMS_MAX; ++i)
 		if (gArmsData[i].code == a)
-			return TRUE;
+			return TRUE; // Found
 
-	return FALSE;
+	return FALSE; // Not found
 }
 
 BOOL UseArmsEnergy(long num)
 {
 	if (gArmsData[gSelectedArms].max_num == 0)
-		return TRUE;
+		return TRUE; // No ammo needed
 	if (gArmsData[gSelectedArms].num == 0)
-		return FALSE;
+		return FALSE; // No ammo left
 
 	gArmsData[gSelectedArms].num -= num;
 
@@ -530,7 +531,7 @@
 	if (gArmsData[gSelectedArms].num < 0)
 		gArmsData[gSelectedArms].num = 0;
 
-	return TRUE;
+	return TRUE; // Was able to spend ammo
 }
 
 BOOL ChargeArmsEnergy(long num)