diff --git a/src/g_game.c b/src/g_game.c index eb60f56d..1f310c2d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2715,6 +2715,8 @@ static boolean DoLoadGame(boolean do_load_autosave) if (demorecording) // So this can only possibly be a -recordfrom command. G_BeginRecording();// Start the -recordfrom, since the game was loaded. + ST_Start(); + return true; } diff --git a/src/m_cheat.c b/src/m_cheat.c index 56f4b13a..546dce23 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -421,6 +421,7 @@ static void cheat_choppers(void) { plyr->weaponowned[wp_chainsaw] = true; plyr->powers[pw_invulnerability] = true; + plyr->bonuscount += 2; // trigger evil grin now displaymsg("%s", s_STSTR_CHOPPERS); // Ty 03/27/98 - externalized } @@ -550,6 +551,7 @@ static void cheat_fa(void) if (i!=am_cell || gamemode!=shareware) plyr->ammo[i] = plyr->maxammo[i]; + plyr->bonuscount += 2; // trigger evil grin now displaymsg("%s", s_STSTR_FAADDED); } @@ -1126,7 +1128,10 @@ static void cheat_weapx(char *buf) if (w >= 0 && w < NUMWEAPONS) { if ((plyr->weaponowned[w] = !plyr->weaponowned[w])) + { + plyr->bonuscount += 2; // trigger evil grin now displaymsg("Weapon Added"); // Ty 03/27/98 - *not* externalized + } else { displaymsg("Weapon Removed"); // Ty 03/27/98 - *not* externalized diff --git a/src/st_sbardef.h b/src/st_sbardef.h index d79711f8..b96e0d48 100644 --- a/src/st_sbardef.h +++ b/src/st_sbardef.h @@ -14,6 +14,7 @@ #ifndef ST_SBARDEF_H #define ST_SBARDEF_H +#include "doomdef.h" #include "doomtype.h" #include "r_defs.h" #include "v_video.h" @@ -180,6 +181,9 @@ typedef struct int faceindex; int facecount; int oldhealth; + + // used for evil grin + boolean oldweaponsowned[NUMWEAPONS]; } sbe_face_t; typedef struct diff --git a/src/st_stuff.c b/src/st_stuff.c index 1595908c..82a343b5 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -126,9 +126,6 @@ static boolean hud_armor_type; // color of armor depends on type static boolean weapon_carousel; -// used for evil grin -static boolean oldweaponsowned[NUMWEAPONS]; - // [crispy] blinking key or skull in the status bar int st_keyorskull[3]; @@ -590,10 +587,13 @@ static void UpdateFace(sbe_face_t *face, player_t *player) for (int i = 0; i < NUMWEAPONS; ++i) { - if (oldweaponsowned[i] != player->weaponowned[i]) + if (face->oldweaponsowned[i] != player->weaponowned[i]) { - doevilgrin = true; - oldweaponsowned[i] = player->weaponowned[i]; + if (face->oldweaponsowned[i] < player->weaponowned[i]) + { + doevilgrin = true; + } + face->oldweaponsowned[i] = player->weaponowned[i]; } } @@ -1047,7 +1047,7 @@ static void UpdateStatusBar(player_t *player) } } -static void ResetElem(sbarelem_t *elem) +static void ResetElem(sbarelem_t *elem, player_t *player) { switch (elem->type) { @@ -1064,6 +1064,10 @@ static void ResetElem(sbarelem_t *elem) face->faceindex = 0; face->facecount = 0; face->oldhealth = -1; + for (int i = 0; i < NUMWEAPONS; i++) + { + face->oldweaponsowned[i] = player->weaponowned[i]; + } } break; @@ -1096,19 +1100,21 @@ static void ResetElem(sbarelem_t *elem) sbarelem_t *child; array_foreach(child, elem->children) { - ResetElem(child); + ResetElem(child, player); } } static void ResetStatusBar(void) { + player_t *player = &players[displayplayer]; + statusbar_t *local_statusbar; array_foreach(local_statusbar, sbardef->statusbars) { sbarelem_t *child; array_foreach(child, local_statusbar->children) { - ResetElem(child); + ResetElem(child, player); } }