From c9e3f39e56214eb14bdd1b26334c94e10e57ee52 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Sun, 8 Jan 2023 18:07:37 +0100 Subject: [PATCH] Goron Merchant adjustments --- src/manager/goronMerchantShopManager.c | 9 +++++---- src/npc/goronMerchant.c | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/manager/goronMerchantShopManager.c b/src/manager/goronMerchantShopManager.c index 3f6ed6b5..feb2f7c0 100644 --- a/src/manager/goronMerchantShopManager.c +++ b/src/manager/goronMerchantShopManager.c @@ -8,16 +8,17 @@ #include "asm.h" #include "flags.h" #include "object.h" +#include "item.h" typedef struct { u16 minType; - u16 maxType; + u16 numTypes; u16 x; u16 y; } GoronShopSpawnData; void GoronMerchantShopManager_Main(GoronMerchantShopManager* this) { - static const GoronShopSpawnData gUnk_08108D5C[3] = { { 0x6e, 0x3, 0x210, 0x210 }, + static const GoronShopSpawnData shopSpawnData[3] = { { 0x6e, 0x3, 0x210, 0x210 }, { 0x71, 0x2, 0x220, 0x210 }, { 0x73, 0x3, 0x230, 0x210 } }; s32 uVar2; @@ -54,12 +55,12 @@ void GoronMerchantShopManager_Main(GoronMerchantShopManager* this) { this->itemActive[2] = 0; this->itemActive[1] = 0; this->itemActive[0] = 0; - spawnData = gUnk_08108D5C; + spawnData = shopSpawnData; count = 0; for (count = 0; count < 3;) { if (CheckGlobalFlag(GORON_KAKERA_L + count) == 0) { Entity* object = - CreateObject(SHOP_ITEM, 0x5c, ((s32)Random() % spawnData->maxType) + spawnData->minType); + CreateObject(SHOP_ITEM, ITEM_KINSTONE, ((s32)Random() % spawnData->numTypes) + spawnData->minType); if (object != NULL) { object->timer = 1; object->subtimer = count; diff --git a/src/npc/goronMerchant.c b/src/npc/goronMerchant.c index f3f9b323..a26eb4b1 100644 --- a/src/npc/goronMerchant.c +++ b/src/npc/goronMerchant.c @@ -5,6 +5,7 @@ #include "flags.h" #include "save.h" #include "npc.h" +#include "item.h" static u32 GoronMerchant_GetSalePrice(Entity*); @@ -134,7 +135,7 @@ void GoronMerchant_TryToBuyKinstone(Entity* this, ScriptExecutionContext* contex if (salePrice <= gSave.stats.rupees) { if (GetAmountInKinstoneBag(gRoomVars.shopItemType2) < 99) { ModRupees(-salePrice); - InitItemGetSequence(0x5c, gRoomVars.shopItemType2, 0); + InitItemGetSequence(ITEM_KINSTONE, gRoomVars.shopItemType2, 0); gRoomVars.shopItemType = 0; gRoomVars.shopItemType2 = 0; context->condition = 1;