mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add cv_scrambleremoved, disable scramble on P_RemoveMobj
Because Monitors and players leaving leak references, disable this crashing to be able to test other stuff at least.
This commit is contained in:
parent
ccd933556d
commit
a55ddef528
3 changed files with 16 additions and 4 deletions
|
|
@ -66,6 +66,10 @@ extern "C" {
|
||||||
|
|
||||||
#define P_GetPlayerViewHeight(player) (41*player->mo->height/48)
|
#define P_GetPlayerViewHeight(player) (41*player->mo->height/48)
|
||||||
|
|
||||||
|
#ifdef PARANOIA
|
||||||
|
#define SCRAMBLE_REMOVED // Force debug build to crash when Removed mobj is accessed
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
THINK_POLYOBJ,
|
THINK_POLYOBJ,
|
||||||
|
|
@ -282,6 +286,9 @@ extern mapthing_t *itemrespawnque[ITEMQUESIZE];
|
||||||
extern tic_t itemrespawntime[ITEMQUESIZE];
|
extern tic_t itemrespawntime[ITEMQUESIZE];
|
||||||
extern size_t iquehead, iquetail;
|
extern size_t iquehead, iquetail;
|
||||||
extern consvar_t cv_gravity, cv_movebob;
|
extern consvar_t cv_gravity, cv_movebob;
|
||||||
|
#ifdef SCRAMBLE_REMOVED
|
||||||
|
extern consvar_t cv_scrambleremoved;
|
||||||
|
#endif
|
||||||
|
|
||||||
void P_RespawnBattleBoxes(void);
|
void P_RespawnBattleBoxes(void);
|
||||||
mobjtype_t P_GetMobjtype(UINT16 mthingtype);
|
mobjtype_t P_GetMobjtype(UINT16 mthingtype);
|
||||||
|
|
|
||||||
10
src/p_mobj.c
10
src/p_mobj.c
|
|
@ -51,6 +51,8 @@
|
||||||
static CV_PossibleValue_t CV_BobSpeed[] = {{0, "MIN"}, {4*FRACUNIT, "MAX"}, {0, NULL}};
|
static CV_PossibleValue_t CV_BobSpeed[] = {{0, "MIN"}, {4*FRACUNIT, "MAX"}, {0, NULL}};
|
||||||
consvar_t cv_movebob = CVAR_INIT ("movebob", "1.0", CV_FLOAT|CV_SAVE, CV_BobSpeed, NULL);
|
consvar_t cv_movebob = CVAR_INIT ("movebob", "1.0", CV_FLOAT|CV_SAVE, CV_BobSpeed, NULL);
|
||||||
|
|
||||||
|
consvar_t cv_scrambleremoved = CVAR_INIT ("scrambleremoved", "On", CV_NETVAR, CV_OnOff, NULL);
|
||||||
|
|
||||||
actioncache_t actioncachehead;
|
actioncache_t actioncachehead;
|
||||||
|
|
||||||
static mobj_t *overlaycap = NULL;
|
static mobj_t *overlaycap = NULL;
|
||||||
|
|
@ -11059,9 +11061,6 @@ mapthing_t *itemrespawnque[ITEMQUESIZE];
|
||||||
tic_t itemrespawntime[ITEMQUESIZE];
|
tic_t itemrespawntime[ITEMQUESIZE];
|
||||||
size_t iquehead, iquetail;
|
size_t iquehead, iquetail;
|
||||||
|
|
||||||
#ifdef PARANOIA
|
|
||||||
#define SCRAMBLE_REMOVED // Force debug build to crash when Removed mobj is accessed
|
|
||||||
#endif
|
|
||||||
void P_RemoveMobj(mobj_t *mobj)
|
void P_RemoveMobj(mobj_t *mobj)
|
||||||
{
|
{
|
||||||
I_Assert(mobj != NULL);
|
I_Assert(mobj != NULL);
|
||||||
|
|
@ -11197,7 +11196,10 @@ void P_RemoveMobj(mobj_t *mobj)
|
||||||
// DBG: set everything in mobj_t to 0xFF instead of leaving it. debug memory error.
|
// DBG: set everything in mobj_t to 0xFF instead of leaving it. debug memory error.
|
||||||
#ifdef SCRAMBLE_REMOVED
|
#ifdef SCRAMBLE_REMOVED
|
||||||
// Invalidate mobj_t data to cause crashes if accessed!
|
// Invalidate mobj_t data to cause crashes if accessed!
|
||||||
memset((UINT8 *)mobj + sizeof(thinker_t), 0xff, sizeof(mobj_t) - sizeof(thinker_t));
|
if (cv_scrambleremoved.value)
|
||||||
|
{
|
||||||
|
memset((UINT8 *)mobj + sizeof(thinker_t), 0xff, sizeof(mobj_t) - sizeof(thinker_t));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1651,6 +1651,9 @@ void R_RegisterEngineStuff(void)
|
||||||
CV_RegisterVar(&cv_maxportals);
|
CV_RegisterVar(&cv_maxportals);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_movebob);
|
CV_RegisterVar(&cv_movebob);
|
||||||
|
#ifdef SCRAMBLE_REMOVED
|
||||||
|
CV_RegisterVar(&cv_scrambleremoved);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Frame interpolation/uncapped
|
// Frame interpolation/uncapped
|
||||||
CV_RegisterVar(&cv_fpscap);
|
CV_RegisterVar(&cv_fpscap);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue