summaryrefslogtreecommitdiff
path: root/src/hexen
diff options
context:
space:
mode:
Diffstat (limited to 'src/hexen')
-rw-r--r--src/hexen/mn_menu.c2
-rw-r--r--src/hexen/p_enemy.c2
-rw-r--r--src/hexen/sb_bar.c12
3 files changed, 13 insertions, 3 deletions
diff --git a/src/hexen/mn_menu.c b/src/hexen/mn_menu.c
index 4c887152..32458a1e 100644
--- a/src/hexen/mn_menu.c
+++ b/src/hexen/mn_menu.c
@@ -153,7 +153,7 @@ static int MenuTime;
static boolean soundchanged;
boolean askforquit;
-boolean typeofask;
+static int typeofask;
static boolean FileMenuKeySteal;
static boolean slottextloaded;
static char SlotText[6][SLOTTEXTLEN + 2];
diff --git a/src/hexen/p_enemy.c b/src/hexen/p_enemy.c
index a8477b22..69dabbc9 100644
--- a/src/hexen/p_enemy.c
+++ b/src/hexen/p_enemy.c
@@ -1135,7 +1135,7 @@ void A_MinotaurRoam(mobj_t * actor)
{
// Turn
if (P_Random() & 1)
- actor->movedir = (++actor->movedir) % 8;
+ actor->movedir = (actor->movedir + 1) % 8;
else
actor->movedir = (actor->movedir + 7) % 8;
FaceMovementDirection(actor);
diff --git a/src/hexen/sb_bar.c b/src/hexen/sb_bar.c
index 13b41ae3..01a2ef0c 100644
--- a/src/hexen/sb_bar.c
+++ b/src/hexen/sb_bar.c
@@ -1798,10 +1798,20 @@ static void CheatIDKFAFunc(player_t * player, Cheat_t * cheat)
{
return;
}
- for (i = 1; i < 8; i++)
+ for (i = 1; i < NUMWEAPONS; i++)
{
player->weaponowned[i] = false;
}
+
+ // In the original code, NUMWEAPONS was 8. So the writes to weaponowned
+ // overflowed the array. We must set the following fields to zero as
+ // well:
+
+ player->mana[0] = 0;
+ player->mana[1] = 0;
+ player->attackdown = 0;
+ player->usedown = 0;
+
player->pendingweapon = WP_FIRST;
P_SetMessage(player, TXT_CHEATIDKFA, true);
}