summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFedja Beader <fedja@protonmail.ch>2023-11-19 03:56:02 +0000
committerLed Mitz <smoothshifter@tuta.io>2023-11-19 03:56:02 +0000
commit2b6c053f91a69dc55d0a4b3bf374d052d8c51cc6 (patch)
tree9a2fbeef9c5789594112129132fe61efc24c5f4b
parent0b68e1c138698232798807ea53329e3fd94a1098 (diff)
downloadserverdata-2b6c053f91a69dc55d0a4b3bf374d052d8c51cc6.tar.gz
serverdata-2b6c053f91a69dc55d0a4b3bf374d052d8c51cc6.tar.bz2
serverdata-2b6c053f91a69dc55d0a4b3bf374d052d8c51cc6.tar.xz
serverdata-2b6c053f91a69dc55d0a4b3bf374d052d8c51cc6.zip
Fix inv space checks.
-rw-r--r--world/map/npc/002-2/stranger.txt16
1 files changed, 15 insertions, 1 deletions
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;