From 2b6c053f91a69dc55d0a4b3bf374d052d8c51cc6 Mon Sep 17 00:00:00 2001 From: Fedja Beader Date: Sun, 19 Nov 2023 03:56:02 +0000 Subject: Fix inv space checks. --- world/map/npc/002-2/stranger.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'world/map') diff --git a/world/map/npc/002-2/stranger.txt b/world/map/npc/002-2/stranger.txt index ae26b8fb..84932c8e 100644 --- a/world/map/npc/002-2/stranger.txt +++ b/world/map/npc/002-2/stranger.txt @@ -322,8 +322,22 @@ L_DyeChecks: mes "[Stranger]"; mes "\"Ok, I'll need a bottle of water first.\""; next; + getinventorylist; - if (@inventorylist_count == 100) goto L_Full_Inv; + // Check if there is enough space for dyed towel and empty bottle. + // does not consider freed space due to powder deletion. + set .@free_slots, (100 - @inventorylist_count); + if (countitem("HitchhikersTowel") == 1) + set .@free_slots, .@free_slots + 1; + if (countitem("BottleOfWater") == 1) + set .@free_slots, .@free_slots + 1; + if (countitem(@warpTowelName$) > 0) + set .@free_slots, .@free_slots + 1; + if (countitem("EmptyBottle") > 0) + set .@free_slots, .@free_slots + 1; + if (.@free_slots < 2) + goto L_Full_Inv; + if (countitem("BottleOfWater") < 1) goto L_No_Water; set @powderCheckCount, 0; goto L_PowderChecks; -- cgit v1.2.3-60-g2f50