mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-23 14:01:14 +00:00
Reset player cheat effects when disabling cheats cvar
This commit is contained in:
parent
6426358377
commit
57a3c4109c
3 changed files with 28 additions and 0 deletions
|
|
@ -1900,6 +1900,8 @@ void CV_CheatsChanged(void)
|
|||
|
||||
// Reset any other cheat command effects here, as well.
|
||||
cv_debug = 0;
|
||||
|
||||
P_ResetPlayerCheats();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -195,6 +195,8 @@ void P_PlayerAfterThink(player_t *player);
|
|||
void P_DoPlayerExit(player_t *player);
|
||||
void P_DoTimeOver(player_t *player);
|
||||
|
||||
void P_ResetPlayerCheats(void);
|
||||
|
||||
void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
fixed_t P_ReturnThrustY(mobj_t *mo, angle_t angle, fixed_t move);
|
||||
|
|
|
|||
24
src/p_user.c
24
src/p_user.c
|
|
@ -4452,3 +4452,27 @@ boolean P_PlayerFullbright(player_t *player)
|
|||
{
|
||||
return (player->invincibilitytimer > 0);
|
||||
}
|
||||
|
||||
void P_ResetPlayerCheats(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
player_t *player = &players[i];
|
||||
mobj_t *thing = player->mo;
|
||||
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
|
||||
player->pflags &= ~(PF_GODMODE);
|
||||
|
||||
if (P_MobjWasRemoved(thing))
|
||||
continue;
|
||||
|
||||
thing->flags &= ~(MF_NOCLIP);
|
||||
|
||||
thing->destscale = mapobjectscale;
|
||||
P_SetScale(thing, thing->destscale);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue