mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 03:52:12 -04:00
fix evil grin getting triggered at level start (and by ID(K)FA) (#2162)
* fix evil grin getting triggered at level start (and by ID(K)FA) * ad one extra ST_Start() call to prevent triggering from savegames
This commit is contained in:
parent
793d5fc4a1
commit
12bd1fed68
@ -2715,6 +2715,8 @@ static boolean DoLoadGame(boolean do_load_autosave)
|
|||||||
if (demorecording) // So this can only possibly be a -recordfrom command.
|
if (demorecording) // So this can only possibly be a -recordfrom command.
|
||||||
G_BeginRecording();// Start the -recordfrom, since the game was loaded.
|
G_BeginRecording();// Start the -recordfrom, since the game was loaded.
|
||||||
|
|
||||||
|
ST_Start();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -421,6 +421,7 @@ static void cheat_choppers(void)
|
|||||||
{
|
{
|
||||||
plyr->weaponowned[wp_chainsaw] = true;
|
plyr->weaponowned[wp_chainsaw] = true;
|
||||||
plyr->powers[pw_invulnerability] = true;
|
plyr->powers[pw_invulnerability] = true;
|
||||||
|
plyr->bonuscount += 2; // trigger evil grin now
|
||||||
displaymsg("%s", s_STSTR_CHOPPERS); // Ty 03/27/98 - externalized
|
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)
|
if (i!=am_cell || gamemode!=shareware)
|
||||||
plyr->ammo[i] = plyr->maxammo[i];
|
plyr->ammo[i] = plyr->maxammo[i];
|
||||||
|
|
||||||
|
plyr->bonuscount += 2; // trigger evil grin now
|
||||||
displaymsg("%s", s_STSTR_FAADDED);
|
displaymsg("%s", s_STSTR_FAADDED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1126,7 +1128,10 @@ static void cheat_weapx(char *buf)
|
|||||||
if (w >= 0 && w < NUMWEAPONS)
|
if (w >= 0 && w < NUMWEAPONS)
|
||||||
{
|
{
|
||||||
if ((plyr->weaponowned[w] = !plyr->weaponowned[w]))
|
if ((plyr->weaponowned[w] = !plyr->weaponowned[w]))
|
||||||
|
{
|
||||||
|
plyr->bonuscount += 2; // trigger evil grin now
|
||||||
displaymsg("Weapon Added"); // Ty 03/27/98 - *not* externalized
|
displaymsg("Weapon Added"); // Ty 03/27/98 - *not* externalized
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
displaymsg("Weapon Removed"); // Ty 03/27/98 - *not* externalized
|
displaymsg("Weapon Removed"); // Ty 03/27/98 - *not* externalized
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#ifndef ST_SBARDEF_H
|
#ifndef ST_SBARDEF_H
|
||||||
#define ST_SBARDEF_H
|
#define ST_SBARDEF_H
|
||||||
|
|
||||||
|
#include "doomdef.h"
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
#include "r_defs.h"
|
#include "r_defs.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
@ -180,6 +181,9 @@ typedef struct
|
|||||||
int faceindex;
|
int faceindex;
|
||||||
int facecount;
|
int facecount;
|
||||||
int oldhealth;
|
int oldhealth;
|
||||||
|
|
||||||
|
// used for evil grin
|
||||||
|
boolean oldweaponsowned[NUMWEAPONS];
|
||||||
} sbe_face_t;
|
} sbe_face_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -126,9 +126,6 @@ static boolean hud_armor_type; // color of armor depends on type
|
|||||||
|
|
||||||
static boolean weapon_carousel;
|
static boolean weapon_carousel;
|
||||||
|
|
||||||
// used for evil grin
|
|
||||||
static boolean oldweaponsowned[NUMWEAPONS];
|
|
||||||
|
|
||||||
// [crispy] blinking key or skull in the status bar
|
// [crispy] blinking key or skull in the status bar
|
||||||
int st_keyorskull[3];
|
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)
|
for (int i = 0; i < NUMWEAPONS; ++i)
|
||||||
{
|
{
|
||||||
if (oldweaponsowned[i] != player->weaponowned[i])
|
if (face->oldweaponsowned[i] != player->weaponowned[i])
|
||||||
{
|
{
|
||||||
doevilgrin = true;
|
if (face->oldweaponsowned[i] < player->weaponowned[i])
|
||||||
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)
|
switch (elem->type)
|
||||||
{
|
{
|
||||||
@ -1064,6 +1064,10 @@ static void ResetElem(sbarelem_t *elem)
|
|||||||
face->faceindex = 0;
|
face->faceindex = 0;
|
||||||
face->facecount = 0;
|
face->facecount = 0;
|
||||||
face->oldhealth = -1;
|
face->oldhealth = -1;
|
||||||
|
for (int i = 0; i < NUMWEAPONS; i++)
|
||||||
|
{
|
||||||
|
face->oldweaponsowned[i] = player->weaponowned[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1096,19 +1100,21 @@ static void ResetElem(sbarelem_t *elem)
|
|||||||
sbarelem_t *child;
|
sbarelem_t *child;
|
||||||
array_foreach(child, elem->children)
|
array_foreach(child, elem->children)
|
||||||
{
|
{
|
||||||
ResetElem(child);
|
ResetElem(child, player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ResetStatusBar(void)
|
static void ResetStatusBar(void)
|
||||||
{
|
{
|
||||||
|
player_t *player = &players[displayplayer];
|
||||||
|
|
||||||
statusbar_t *local_statusbar;
|
statusbar_t *local_statusbar;
|
||||||
array_foreach(local_statusbar, sbardef->statusbars)
|
array_foreach(local_statusbar, sbardef->statusbars)
|
||||||
{
|
{
|
||||||
sbarelem_t *child;
|
sbarelem_t *child;
|
||||||
array_foreach(child, local_statusbar->children)
|
array_foreach(child, local_statusbar->children)
|
||||||
{
|
{
|
||||||
ResetElem(child);
|
ResetElem(child, player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user