diff --git a/src/command.c b/src/command.c index 6358858cb..75e8fc06a 100644 --- a/src/command.c +++ b/src/command.c @@ -1900,6 +1900,8 @@ void CV_CheatsChanged(void) // Reset any other cheat command effects here, as well. cv_debug = 0; + + P_ResetPlayerCheats(); } } diff --git a/src/p_local.h b/src/p_local.h index 5fc73f1a2..4f9fa9c23 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -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); diff --git a/src/p_user.c b/src/p_user.c index b1c35a839..a02b8e223 100644 --- a/src/p_user.c +++ b/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); + } +}