summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLed Mitz <smoothshifter@tuta.io>2023-11-19 03:56:03 +0000
committerLed Mitz <smoothshifter@tuta.io>2023-11-19 03:56:03 +0000
commit53c1f8c78cff7f031ada478df191626976d8da64 (patch)
treed4e9824dc9d6bbf05ea0772d6220da4786c3479f
parent32323c27f87ea7576c82ac89bf3137bc1d24c72d (diff)
parent2b6c053f91a69dc55d0a4b3bf374d052d8c51cc6 (diff)
downloadserverdata-53c1f8c78cff7f031ada478df191626976d8da64.tar.gz
serverdata-53c1f8c78cff7f031ada478df191626976d8da64.tar.bz2
serverdata-53c1f8c78cff7f031ada478df191626976d8da64.tar.xz
serverdata-53c1f8c78cff7f031ada478df191626976d8da64.zip
Merge branch 'bottlesFromStranger' into 'master'
Fix inv space checks. See merge request legacy/serverdata!690
-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;