groundwork: u.uinwater manipulation

Toggle u.uinwater on or off in just one place.
This commit is contained in:
PatR
2020-04-03 01:04:27 -07:00
parent 5f9714bf92
commit a2338e92aa
9 changed files with 22 additions and 13 deletions

View File

@@ -2086,6 +2086,14 @@ switch_terrain()
g.context.botl = TRUE; /* update Lev/Fly status condition */
}
/* set or clear u.uinwater */
void
set_uinwater(in_out)
int in_out;
{
u.uinwater = in_out;
}
/* extracted from spoteffects; called by spoteffects to check for entering or
leaving a pool of water/lava, and by moveloop to check for staying on one;
returns true to skip rest of spoteffects */
@@ -2119,7 +2127,7 @@ boolean newspot; /* true if called by spoteffects */
if (!still_inwater) {
boolean was_underwater = (Underwater && !Is_waterlevel(&u.uz));
u.uinwater = 0; /* leave the water */
set_uinwater(0); /* u.uinwater = 0; leave the water */
if (was_underwater) { /* restore vision */
docrt();
g.vision_full_recalc = 1;