From 372872eeea3fff1f1f648ea7f00c809a3d1820ce Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Tue, 17 Sep 2019 11:54:00 +0200 Subject: [PATCH] Some comments and a FIX_BUGS Signed-off-by: Gabriel Ravier --- src/ArmsItem.cpp | 8 ++++++-- src/ArmsItem.h | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ArmsItem.cpp b/src/ArmsItem.cpp index 4247e258..e0fcb936 100644 --- a/src/ArmsItem.cpp +++ b/src/ArmsItem.cpp @@ -27,6 +27,9 @@ static int gCampTitleY; 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 @@ BOOL SubItemData(long code) 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 @@ BOOL SubItemData(long code) return TRUE; } +/// Handle the moving static void MoveCampCursor() { int arms_num = 0; diff --git a/src/ArmsItem.h b/src/ArmsItem.h index 6960fce3..ec74a0ed 100644 --- a/src/ArmsItem.h +++ b/src/ArmsItem.h @@ -44,10 +44,10 @@ extern ARMS gArmsData[ARMS_MAX]; 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();