shithub: cstory

Download patch

ref: eb46198635fde10abd14ec48b5241fe97ff38c94
parent: f6ed183687d60c4d8c7bf20c5e9f38b09e52203c
author: Gabriel Ravier <gabravier@gmail.com>
date: Sat Sep 21 16:06:09 EDT 2019

Add some comments for the searching of codes

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

--- a/src/ArmsItem.cpp
+++ b/src/ArmsItem.cpp
@@ -42,6 +42,7 @@
 
 BOOL AddArmsData(long code, long max_num)
 {
+	// Search for code
 	int i = 0;
 	while (i < ARMS_MAX)
 	{
@@ -76,7 +77,7 @@
 
 BOOL SubArmsData(long code)
 {
-	// Find weapon index
+	// Search for code
 	int i;
 	for (i = 0; i < ARMS_MAX; ++i)
 		if (gArmsData[i].code == code)
@@ -102,6 +103,7 @@
 
 BOOL TradeArms(long code1, long code2, long max_num)
 {
+	// Search for code1
 	int i = 0;
 	while (i < ARMS_MAX)
 	{
@@ -125,6 +127,7 @@
 
 BOOL AddItemData(long code)
 {
+	// Search for code
 	int i = 0;
 	while (i < ITEM_MAX)
 	{
@@ -147,6 +150,7 @@
 
 BOOL SubItemData(long code)
 {
+	// Search for code
 	int i;
 	for (i = 0; i < ITEM_MAX; ++i)
 		if (gItemData[i].code == code)