From b5d98ec93eb1582bc4627de4b65458c9e67b6477 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Fri, 13 May 2022 20:05:52 -0400 Subject: [PATCH] prevent overwriting wild mon held items --- src/pokemon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pokemon.c b/src/pokemon.c index 71176d2eb6..65aad61962 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6459,6 +6459,9 @@ void SetWildMonHeldItem(void) for (i = 0; i < count; i++) { + if (GetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM) != ITEM_NONE) + continue; // prevent ovewriting previously set item + rnd = Random() % 100; species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES, 0); if (gMapHeader.mapLayoutId == LAYOUT_ALTERING_CAVE)