foxygit / doom Log in
commit 1f5a1e43d44676e692a0513a02ff1d690ae86ca9
Author:     Turo Lamminen <turol@iki.fi>
AuthorDate: Tue Oct 11 12:01:13 2022 +0300
Commit:     Turo Lamminen <turol@iki.fi>
CommitDate: Tue Oct 11 12:01:13 2022 +0300

    heretic: Rename NUMKEYS to NUM_KEY_TYPES
---
 src/heretic/am_map.c  | 2 +-
 src/heretic/doomdef.h | 4 ++--
 src/heretic/p_mobj.c  | 2 +-
 src/heretic/p_saveg.c | 6 +++---
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/heretic/am_map.c b/src/heretic/am_map.c
index be2b0dbb..7dfd7857 100644
--- a/src/heretic/am_map.c
+++ b/src/heretic/am_map.c
@@ -30,7 +30,7 @@
 #include "doomkeys.h"
 #include "v_video.h"

-vertex_t KeyPoints[NUMKEYS];
+vertex_t KeyPoints[NUM_KEY_TYPES];

 #define NUMALIAS 3              // Number of antialiased lines.

diff --git a/src/heretic/doomdef.h b/src/heretic/doomdef.h
index 8fbd362e..9cda674b 100644
--- a/src/heretic/doomdef.h
+++ b/src/heretic/doomdef.h
@@ -302,7 +302,7 @@ typedef enum
     key_yellow,
     key_green,
     key_blue,
-    NUMKEYS
+    NUM_KEY_TYPES
 } keytype_t;

 typedef enum
@@ -439,7 +439,7 @@ typedef struct player_s
     int artifactCount;
     int inventorySlotNum;
     int powers[NUMPOWERS];
-    boolean keys[NUMKEYS];
+    boolean keys[NUM_KEY_TYPES];
     boolean backpack;
     signed int frags[MAXPLAYERS];       // kills of other players
     weapontype_t readyweapon;
diff --git a/src/heretic/p_mobj.c b/src/heretic/p_mobj.c
index c3083412..74d232b4 100644
--- a/src/heretic/p_mobj.c
+++ b/src/heretic/p_mobj.c
@@ -1004,7 +1004,7 @@ void P_SpawnPlayer(mapthing_t * mthing)
     P_SetupPsprites(p);         // setup gun psprite
     if (deathmatch)
     {                           // Give all keys in death match mode
-        for (i = 0; i < NUMKEYS; i++)
+        for (i = 0; i < NUM_KEY_TYPES; i++)
         {
             p->keys[i] = true;
             if (p == &players[consoleplayer])
diff --git a/src/heretic/p_saveg.c b/src/heretic/p_saveg.c
index 36cfc617..d96ced3b 100644
--- a/src/heretic/p_saveg.c
+++ b/src/heretic/p_saveg.c
@@ -409,8 +409,8 @@ static void saveg_read_player_t(player_t *str)
         str->powers[i] = SV_ReadLong();
     }

-    // boolean keys[NUMKEYS];
-    for (i=0; i<NUMKEYS; ++i)
+    // boolean keys[NUM_KEY_TYPES];
+    for (i = 0; i < NUM_KEY_TYPES; ++i)
     {
         str->keys[i] = SV_ReadLong();
     }
@@ -579,7 +579,7 @@ static void saveg_write_player_t(player_t *str)
     }

     // boolean keys[NUMKEYS];
-    for (i=0; i<NUMKEYS; ++i)
+    for (i = 0; i < NUM_KEY_TYPES; ++i)
     {
         SV_WriteLong(str->keys[i]);
     }