]> granicus.if.org Git - nethack/commitdiff
set_uinwater() bit
authorPatR <rankin@nethack.org>
Fri, 3 Apr 2020 18:39:40 +0000 (11:39 -0700)
committerPatR <rankin@nethack.org>
Fri, 3 Apr 2020 18:39:40 +0000 (11:39 -0700)
Assignment target is a one bit wide bitfield; callers only pass 0 or 1
but guarantee that value fits so that no compiler has reason to complain.

src/hack.c

index 06b12d7e56c0d3cd24cef6e6984b361085050d29..a2fb0f734ba815ee85e698ce104d8e7e870ce2ba 100644 (file)
@@ -2091,7 +2091,7 @@ void
 set_uinwater(in_out)
 int in_out;
 {
-    u.uinwater = in_out;
+    u.uinwater = in_out ? 1 : 0;
 }
 
 /* extracted from spoteffects; called by spoteffects to check for entering or