Apply loc_t type.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 7 Apr 2023 12:18:50 +0000 (08:18 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 7 Apr 2023 12:18:50 +0000 (08:18 -0400)
advent.h
main.c

index 1162106f3a3b6a18399634ba93de11ec9fcf4076..c1d3132a6b243a44648743c1963058ae68ffb62b 100644 (file)
--- 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 cdc83bafddeb15d090ff9ecd5a62c8c2e270316b..e3e6a96dc29f3e4ea87a5f0636972cf2887cddb7 100644 (file)
--- 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;