Add missing check to prevents water grinding

This commit is contained in:
Bassoonian 2023-12-08 01:05:54 +01:00
parent 6173f9b81d
commit 1e0b895ecb
3 changed files with 10 additions and 0 deletions

View file

@ -216,6 +216,8 @@ BerryTree_EventScript_WantToWater::
.endif
checkitem ITEM_WAILMER_PAIL
goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater
specialvar VAR_RESULT, CanWaterBerryPlot
goto_if_eq VAR_RESULT, FALSE, BerryTree_EventScript_DontWater
special ObjectEventInteractionGetBerryName
msgbox BerryTree_Text_WantToWater, MSGBOX_YESNO
goto_if_eq VAR_RESULT, YES, BerryTree_EventScript_WaterBerry

View file

@ -549,3 +549,4 @@ gSpecials::
def_special ObjectEventInteractionClearBerryPests
def_special ObjectEventInteractionBerryHasWeed
def_special ObjectEventInteractionBerryHasPests
def_special CanWaterBerryPlot

View file

@ -2229,6 +2229,13 @@ static u8 GetPestsBonusByBerryType(u8 berry)
return (bonus == 0) ? 2 : bonus * 5;
}
bool8 CanWaterBerryPlot(void)
{
if (!OW_BERRY_MOISTURE || OW_BERRY_ALWAYS_WATERABLE)
return TRUE;
return (gSaveBlock1Ptr->berryTrees[GetObjectEventBerryTreeId(gSelectedObjectEvent)].moistureLevel == 0);
}
void ObjectEventInteractionGetBerryTreeData(void)
{
u8 id;