Mercurial > hg > early-roguelike
comparison xrogue/actions.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 | f54901b9c39b |
| children |
comparison
equal
deleted
inserted
replaced
| 303:e06ebc407615 | 304:e52a8a7ad4c5 |
|---|---|
| 433 * a monster is in a room and the player is not in that room, the | 433 * a monster is in a room and the player is not in that room, the |
| 434 * monster looks for the best door out. If we counted doors as part | 434 * monster looks for the best door out. If we counted doors as part |
| 435 * of the room, the monster would already be on the best door out; | 435 * of the room, the monster would already be on the best door out; |
| 436 * so he would never move. | 436 * so he would never move. |
| 437 */ | 437 */ |
| 438 if ((sch = mvwinch(stdscr, th->t_pos.y, th->t_pos.x)) == DOOR || | 438 sch = mvwinch(stdscr, th->t_pos.y, th->t_pos.x) & A_CHARTEXT; |
| 439 sch == SECRETDOOR || sch == PASSAGE) { | 439 if (sch == DOOR || sch == SECRETDOOR || sch == PASSAGE) { |
| 440 rer = NULL; | 440 rer = NULL; |
| 441 } | 441 } |
| 442 this = *th->t_dest; | 442 this = *th->t_dest; |
| 443 | 443 |
| 444 /* | 444 /* |
| 462 *entrance; /* Place just inside doorway */ | 462 *entrance; /* Place just inside doorway */ |
| 463 int exity, exitx; /* Door's coordinates */ | 463 int exity, exitx; /* Door's coordinates */ |
| 464 char dch='\0'; /* Door character */ | 464 char dch='\0'; /* Door character */ |
| 465 | 465 |
| 466 if ((th->t_doorgoal.x != -1) && (th->t_doorgoal.y != -1)) | 466 if ((th->t_doorgoal.x != -1) && (th->t_doorgoal.y != -1)) |
| 467 dch = mvwinch(stdscr, th->t_doorgoal.y, th->t_doorgoal.x); | 467 dch = mvwinch(stdscr, th->t_doorgoal.y, th->t_doorgoal.x) & |
| 468 A_CHARTEXT; | |
| 468 | 469 |
| 469 /* Do we have a valid goal? */ | 470 /* Do we have a valid goal? */ |
| 470 if ((dch == PASSAGE || dch == DOOR) && /* A real door */ | 471 if ((dch == PASSAGE || dch == DOOR) && /* A real door */ |
| 471 (!flee || !ce(th->t_doorgoal, *th->t_dest))) { /* Prey should not | 472 (!flee || !ce(th->t_doorgoal, *th->t_dest))) { /* Prey should not |
| 472 * be at door if | 473 * be at door if |
| 486 exit = DOORPTR(exitptr); | 487 exit = DOORPTR(exitptr); |
| 487 exity = exit->y; | 488 exity = exit->y; |
| 488 exitx = exit->x; | 489 exitx = exit->x; |
| 489 | 490 |
| 490 /* Make sure it is a real door */ | 491 /* Make sure it is a real door */ |
| 491 dch = mvwinch(stdscr, exity, exitx); | 492 dch = mvwinch(stdscr, exity, exitx) & A_CHARTEXT; |
| 492 if (dch == PASSAGE || dch == DOOR) { | 493 if (dch == PASSAGE || dch == DOOR) { |
| 493 /* Don't count a door if we are fleeing from someone and | 494 /* Don't count a door if we are fleeing from someone and |
| 494 * he is standing on it. Also, don't count it if he is | 495 * he is standing on it. Also, don't count it if he is |
| 495 * standing in the doorway. | 496 * standing in the doorway. |
| 496 */ | 497 */ |
