From bad36c8672e8132fbdf98bec1109b2b049c62690 Mon Sep 17 00:00:00 2001 From: Alex Smith Date: Sat, 6 Jan 2018 00:31:11 +0000 Subject: [PATCH] Fix an exploit involving bags and potions of water Discovered while writing the previous commit. If you dipped a sack full of potions into an uncursed potion of water, the potions would dilute but you wouldn't lose the original potion, letting you repeat until all were diluted. Allowing people to do this trick to blank multiple potions from one potion of water seems like it's not an abuse, given that it can be done in a more tedious way with water walking or the like and it costs resources, but it's definitely abusive to make it possible entirely for free. --- src/trap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/trap.c b/src/trap.c index 27914fba6..66ab163f8 100644 --- a/src/trap.c +++ b/src/trap.c @@ -3430,12 +3430,16 @@ boolean force; pline("Water gets into your %s!", ostr); water_damage_chain(obj->cobj, FALSE); - return ER_NOTHING; + return ER_DAMAGED; /* contents were damaged */ } else if (obj->otyp == OILSKIN_SACK) { if (carried(obj)) pline("Some water slides right off your %s.", ostr); makeknown(OILSKIN_SACK); - return ER_NOTHING; + /* not actually damaged, but because we /didn't/ get the "water + gets into!" message, the player now has more information and + thus we need to waste any potion they may have used (also, + flavourwise the water is now on the floor) */ + return ER_DAMAGED; } else if (!force && (Luck + 5) > rn2(20)) { /* chance per item of sustaining damage: * max luck: 10%