comparison arogue7/move.c @ 200:1cd604c827a3

Advanced Rogue 7: initialize multiple variables. MSVC complained that they might be used uninitialized. In some cases, this might have been possible. XRogue already has initializations for all these variables.
author John "Elwin" Edwards
date Wed, 12 Aug 2015 15:42:02 -0400
parents a0a57cf42810
children f9ef86cf22b2
comparison
equal deleted inserted replaced
199:efdbeec0816d 200:1cd604c827a3
44 be_trapped(th, tc) 44 be_trapped(th, tc)
45 register struct thing *th; 45 register struct thing *th;
46 register coord *tc; 46 register coord *tc;
47 { 47 {
48 register struct trap *tp; 48 register struct trap *tp;
49 register char ch, *mname; 49 register char ch, *mname = "";
50 register bool is_player = (th == &player), 50 register bool is_player = (th == &player),
51 can_see; 51 can_see;
52 register struct linked_list *mitem; 52 register struct linked_list *mitem = NULL;
53 register struct thing *mp; 53 register struct thing *mp;
54 54
55 55
56 /* Can the player see the creature? */ 56 /* Can the player see the creature? */
57 can_see = (cansee(tc->y, tc->x) && (is_player || !invisible(th))); 57 can_see = (cansee(tc->y, tc->x) && (is_player || !invisible(th)));
762 int dy, dx; 762 int dy, dx;
763 { 763 {
764 register struct room *rp, *orp; 764 register struct room *rp, *orp;
765 register char ch; 765 register char ch;
766 struct linked_list *item; 766 struct linked_list *item;
767 register struct thing *tp; 767 register struct thing *tp = NULL;
768 coord old_hero; 768 coord old_hero;
769 register int wasfirstmove, moved, num_hits; 769 register int wasfirstmove, moved, num_hits;
770 bool changed=FALSE; /* Did we switch places with a friendly monster? */ 770 bool changed=FALSE; /* Did we switch places with a friendly monster? */
771 771
772 wasfirstmove = firstmove; 772 wasfirstmove = firstmove;