diff rogue4/sticks.c @ 304:e52a8a7ad4c5

Fix many compiler warnings. There should only be two changes in behavior: arogue7/fight.c, arogue7/fight.c: a to-hit bonus is now correctly applied to characters who are not monks instead of monks who are not empty-handed. urogue/fight.c: fixed an interaction with the "debug" macro that could cause the wrong message to be displayed.
author John "Elwin" Edwards
date Wed, 14 Apr 2021 18:55:33 -0400
parents 1b73a8641b37
children
line wrap: on
line diff
--- a/rogue4/sticks.c	Sat Mar 20 22:36:52 2021 -0400
+++ b/rogue4/sticks.c	Wed Apr 14 18:55:33 2021 -0400
@@ -159,7 +159,8 @@
 			    rnd_pos(&rooms[rm], &tp->t_pos);
 			} until (winat(tp->t_pos.y, tp->t_pos.x) == FLOOR);
 			tp->t_room = roomin(&tp->t_pos);
-			tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x);
+			tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x) & 
+				A_CHARTEXT;
 			if (see_monst(tp))
 			    mvaddch(tp->t_pos.y, tp->t_pos.x, tp->t_disguise);
 			else if (on(player, SEEMONST))
@@ -175,7 +176,8 @@
 			tp->t_pos.x = hero.x + delta.x;
 		    
 		        if (tp->t_pos.y != y || tp->t_pos.x != x)
-			    tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x);
+			    tp->t_oldch = mvinch(tp->t_pos.y, tp->t_pos.x) &
+				A_CHARTEXT;
 		    }
 		    moat(y, x) = NULL;
 		    moat(tp->t_pos.y, tp->t_pos.x) = tp;
@@ -423,10 +425,12 @@
 		    if (!save(VS_MAGIC))
 		    {
 			if ((pstats.s_hpt -= roll(6, 6)) <= 0)
+			{
 			    if (start == &hero)
 				death('b');
 			    else
 				death(moat(start->y, start->x)->t_type);
+			}
 			used = TRUE;
 			if (terse)
 			    msg("the %s hits", name);