Mercurial > hg > early-roguelike
comparison srogue/sticks.c @ 311:28e22fb35989
Fix one more batch of compiler warnings.
A few of these were potential bugs.
author | John "Elwin" Edwards |
---|---|
date | Tue, 04 May 2021 21:03:47 -0400 |
parents | e52a8a7ad4c5 |
children |
comparison
equal
deleted
inserted
replaced
310:827441d05b3e | 311:28e22fb35989 |
---|---|
228 if (item == NULL) | 228 if (item == NULL) |
229 break; | 229 break; |
230 tp = THINGPTR(item); | 230 tp = THINGPTR(item); |
231 omonst = tp->t_indx; | 231 omonst = tp->t_indx; |
232 if (wh == WS_POLYM && !curse) { | 232 if (wh == WS_POLYM && !curse) { |
233 int newmonst; | |
233 detach(mlist, item); | 234 detach(mlist, item); |
234 discard(item); | 235 discard(item); |
235 oldch = tp->t_oldch; | 236 oldch = tp->t_oldch; |
236 delta.y = y; | 237 delta.y = y; |
237 delta.x = x; | 238 delta.x = x; |
238 monster = rnd_mon(FALSE, TRUE); | 239 newmonst = rnd_mon(FALSE, TRUE); |
239 item = new_monster(monster, &delta, FALSE); | 240 item = new_monster(newmonst, &delta, FALSE); |
240 if (!(tp->t_flags & ISRUN)) | 241 if (!(tp->t_flags & ISRUN)) |
241 runto(&delta, &hero); | 242 runto(&delta, &hero); |
242 if (isalpha(mvwinch(cw, y, x))) | 243 if (isalpha(mvwinch(cw, y, x))) |
243 mvwaddch(cw, y, x, monsters[monster].m_show); | 244 mvwaddch(cw, y, x, monsters[newmonst].m_show); |
244 tp->t_oldch = oldch; | 245 tp->t_oldch = oldch; |
245 ws_know[WS_POLYM] |= (monster != omonst); | 246 ws_know[WS_POLYM] |= (newmonst != omonst); |
246 } | 247 } |
247 else if (wh == WS_MINVIS && !bless) { | 248 else if (wh == WS_MINVIS && !bless) { |
248 tp->t_flags |= ISINVIS; | 249 tp->t_flags |= ISINVIS; |
249 mvwaddch(cw,y,x,tp->t_oldch); /* hide em */ | 250 mvwaddch(cw,y,x,tp->t_oldch); /* hide em */ |
250 runto(&tp->t_pos, &hero); | 251 runto(&tp->t_pos, &hero); |