From 7fb155ff774c757746fad0e2cc9edb66efd48212 Mon Sep 17 00:00:00 2001 From: Aetias Date: Wed, 27 Dec 2023 13:22:21 +0100 Subject: [PATCH] 92% match `Inventory::Save` --- Makefile | 2 +- src/Inventory.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1f433542..7b034a53 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ MW_LD := $(TOOLS_DIR)/mwccarm/$(MW_VER)/mwldarm.exe MW_LICENSE := $(TOOLS_DIR)/mwccarm/license.dat ASM_FLAGS := -proc arm5te -d $(REGION) -i asm -msgstyle gcc -CC_FLAGS := -O2 -enum int -i include -nolink -d $(REGION) +CC_FLAGS := -O2 -enum int -i include -nolink -d $(REGION) -char signed LD_FLAGS := -proc arm946e -nostdlib -interworking -nodead -m Entry -map closure,unused -o main.bin -msgstyle gcc ifeq ($(NONMATCHING),1) diff --git a/src/Inventory.cpp b/src/Inventory.cpp index fdc23159..f0c01724 100644 --- a/src/Inventory.cpp +++ b/src/Inventory.cpp @@ -39,11 +39,12 @@ NONMATCH void Inventory::Save(SaveInventory *save) { for (s32 i = 0; i < Gem_COUNT; ++i) { save->numGems[i] = this->mNumGems[i]; } - for (s32 i = 0; i < ShipPart_COUNT; ++i) { + for (s32 i = 0, j = 0; i < ShipPart_COUNT; ++i, j = 0) { save->equippedShipParts[i] = this->mEquippedShipParts[i]; - for (s32 j = 0; j < ShipType_COUNT; ++j) { + do { save->shipParts[i].parts[j] = this->mShipParts[i].parts[j]; - } + ++j; + } while (j < ShipType_COUNT); } save->shipPartPricesShown = this->mShipPartPricesShown; for (s32 i = 0; i < Treasure_COUNT; ++i) {