From: Eric S. Raymond Date: Fri, 7 Apr 2023 12:18:50 +0000 (-0400) Subject: Apply loc_t type. X-Git-Tag: 1.16~21 X-Git-Url: https://jxself.org/git/?p=open-adventure.git;a=commitdiff_plain;h=195e6e149b401cd8d27f406834c7f54a8cca4909 Apply loc_t type. --- diff --git a/advent.h b/advent.h index 1162106..c1d3132 100644 --- a/advent.h +++ b/advent.h @@ -167,7 +167,7 @@ struct game_t { int holdng; // number of objects being carried int igo; // # uses of "go" instead of a direction int iwest; // # times he's said "west" instead of "w" - int knfloc; // knife location; 0 if none, -1 after caveat + loc_t knfloc; // knife location; LOC_NOWERE if none, -1 after caveat turn_t limit; // lifetime of lamp loc_t loc; // where player is now loc_t newloc; // where player is going diff --git a/main.c b/main.c index cdc83ba..e3e6a96 100644 --- a/main.c +++ b/main.c @@ -370,7 +370,7 @@ static bool dwarfmove(void) ++game.dtotal; if (game.odloc[i] == game.dloc[i]) { ++attack; - if (game.knfloc >= 0) + if (game.knfloc >= LOC_NOWHERE) game.knfloc = game.loc; if (randrange(1000) < 95 * (game.dflag - 2)) ++stick;