From 350e72fb3eef19a9137b887008c628b31b1a0b2e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 23 Feb 2010 23:03:43 +0000 Subject: [PATCH] - added an option to disable player translations in single player games. SVN r2173 (trunk) --- src/m_cheat.cpp | 5 ++++- src/p_mobj.cpp | 13 ++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 508043f47..23383a6fe 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -46,6 +46,8 @@ #include "d_dehacked.h" #include "gi.h" +EXTERN_CVAR(Bool, r_forceplayertranslation) + // [RH] Actually handle the cheat. The cheat code in st_stuff.c now just // writes some bytes to the network data stream, and the network code // later calls us. @@ -319,7 +321,8 @@ void cht_DoCheat (player_t *player, int cheat) player->mo->special1 = 0; // required for the Hexen fighter's fist attack. // This gets set by AActor::Die as flag for the wimpy death and must be reset here. player->mo->SetState (player->mo->SpawnState); - player->mo->Translation = TRANSLATION(TRANSLATION_Players, BYTE(player-players)); + if (multiplayer || r_forceplayertranslation) + player->mo->Translation = TRANSLATION(TRANSLATION_Players, BYTE(player-players)); player->mo->DamageType = NAME_None; // player->mo->GiveDefaultInventory(); if (player->ReadyWeapon != NULL) diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 9a0f9c692..efbe88837 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -114,6 +114,14 @@ CUSTOM_CVAR (Float, sv_gravity, 800.f, CVAR_SERVERINFO|CVAR_NOSAVE) level.gravity = self; } +CUSTOM_CVAR(Bool, r_forceplayertranslation, false, CVAR_ARCHIVE|CVAR_NOINITCALL) +{ + if (!multiplayer && players[0].mo != NULL) + { + players[0].mo->Translation = self? TRANSLATION(TRANSLATION_Players, 0) : 0; + } +} + CVAR (Bool, cl_missiledecals, true, CVAR_ARCHIVE) CVAR (Bool, addrocketexplosion, false, CVAR_ARCHIVE) @@ -3990,7 +3998,10 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer) R_BuildPlayerTranslation (playernum); // [RH] set color translations for player sprites - mobj->Translation = TRANSLATION(TRANSLATION_Players,playernum); + if (multiplayer || r_forceplayertranslation) + mobj->Translation = TRANSLATION(TRANSLATION_Players,playernum); + else + mobj->Translation = 0; mobj->angle = spawn_angle; mobj->pitch = mobj->roll = 0;