fix github pull request #418 - towel wetness
Fire damage would dry out a wet towel but never all the way to 0. Water damage would wet a towel but if it was already wet, its wetness might decrease. This uses the pull request's change for increasing the wetness but changes dry_a_towel so that the original code for decreasing that will work as is. Using wet_a_towel() to set wetness to 0 doesn't make much sense, so still won't do so; dry_a_towel() does and now will. This also adds missing perm_invent update for towels in inventory changing wetness. Fixes #418
This commit is contained in:
10
src/weapon.c
10
src/weapon.c
@@ -984,16 +984,18 @@ boolean verbose;
|
||||
with your wet towel" message on next attack with it */
|
||||
if (obj == uwep)
|
||||
g.unweapon = !is_wet_towel(obj);
|
||||
if (carried(obj))
|
||||
update_inventory();
|
||||
}
|
||||
|
||||
/* decrease a towel's wetness */
|
||||
/* decrease a towel's wetness; unlike when wetting, 0 is not a no-op */
|
||||
void
|
||||
dry_a_towel(obj, amt, verbose)
|
||||
struct obj *obj;
|
||||
int amt; /* positive: new value; negative: decrement by -amt; zero: no-op */
|
||||
int amt; /* positive or zero: new value; negative: decrement by abs(amt) */
|
||||
boolean verbose;
|
||||
{
|
||||
int newspe = (amt <= 0) ? obj->spe + amt : amt;
|
||||
int newspe = (amt < 0) ? obj->spe + amt : amt;
|
||||
|
||||
/* new state is only reported if it's a decrease */
|
||||
if (newspe < obj->spe) {
|
||||
@@ -1013,6 +1015,8 @@ boolean verbose;
|
||||
bashing with your towel" message on next attack with it */
|
||||
if (obj == uwep)
|
||||
g.unweapon = !is_wet_towel(obj);
|
||||
if (carried(obj))
|
||||
update_inventory();
|
||||
}
|
||||
|
||||
/* copy the skill level name into the given buffer */
|
||||
|
||||
Reference in New Issue
Block a user