shithub: cstory

Download patch

ref: ba8f2138b8c19a91dd275a38c98e4c116c4eac62
parent: 4fc38593d2f686004bc4021f1106ff7c99aae9a0
author: Gabriel Ravier <gabravier@gmail.com>
date: Mon Sep 23 15:52:34 EDT 2019

Finished commenting ArmsItem basically

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

--- a/src/ArmsItem.cpp
+++ b/src/ArmsItem.cpp
@@ -546,7 +546,7 @@
 	for (int a = 0; a < ARMS_MAX; a++)
 	{
 		if (gArmsData[a].code == 0)
-			continue;
+			continue; // Don't change empty weapons
 
 		gArmsData[a].num = gArmsData[a].max_num;
 	}
@@ -554,6 +554,7 @@
 
 int RotationArms()
 {
+	// Get amount of weapons
 	int arms_num = 0;
 	while (gArmsData[arms_num].code != 0)
 		++arms_num;
@@ -563,6 +564,7 @@
 
 	ResetSpurCharge();
 
+	// Select next valid weapon
 	++gSelectedArms;
 
 	while (gSelectedArms < arms_num)
@@ -577,7 +579,7 @@
 		gSelectedArms = 0;
 
 	gArmsEnergyX = 0x20;
-	PlaySoundObject(4, 1);
+	PlaySoundObject(SND_SWITCH_WEAPON, 1);
 
 	return gArmsData[gSelectedArms].code;
 }
@@ -584,6 +586,7 @@
 
 int RotationArmsRev()
 {
+	// Get amount of weapons
 	int arms_num = 0;
 	while (gArmsData[arms_num].code != 0)
 		++arms_num;
@@ -593,6 +596,7 @@
 
 	ResetSpurCharge();
 
+	// Select previous valid weapon
 	if (--gSelectedArms < 0)
 		gSelectedArms = arms_num - 1;
 
@@ -605,7 +609,7 @@
 	}
 
 	gArmsEnergyX = 0;
-	PlaySoundObject(4, 1);
+	PlaySoundObject(SND_SWITCH_WEAPON, 1);
 
 	return gArmsData[gSelectedArms].code;
 }
@@ -614,5 +618,5 @@
 {
 	gSelectedArms = 0;
 	gArmsEnergyX = 0x20;
-	PlaySoundObject(4, 1);
+	PlaySoundObject(SND_SWITCH_WEAPON, 1);
 }