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.
This commit is contained in:
Alex Smith
2018-01-06 00:31:11 +00:00
parent 2b7b2af9eb
commit bad36c8672

View File

@@ -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%