diff --git a/source/core/cheats.cpp b/source/core/cheats.cpp index cb4fb0d59..107f5553d 100644 --- a/source/core/cheats.cpp +++ b/source/core/cheats.cpp @@ -114,6 +114,21 @@ void genericCheat(int player, uint8_t** stream, bool skip) // //--------------------------------------------------------------------------- +CCMD(fly) +{ + if (!CheckCheatmode(true, true)) + { + Net_WriteByte(DEM_GENERICCHEAT); + Net_WriteByte(CHT_FLY); + } +} + +//--------------------------------------------------------------------------- +// +// +// +//--------------------------------------------------------------------------- + CCMD(god) { if (!CheckCheatmode(true, true)) // Right now the god cheat is a global setting in some games and not a player property. This should be changed. diff --git a/source/core/d_protocol.h b/source/core/d_protocol.h index a7a924a8f..6fe43f16f 100644 --- a/source/core/d_protocol.h +++ b/source/core/d_protocol.h @@ -121,6 +121,9 @@ enum ECheat CHT_KFC, CHT_MONSTERS, + // Shadow Warrior + CHT_FLY, + // Blood kCheatSatchel, kCheatKevorkian, diff --git a/source/sw/src/cheats.cpp b/source/sw/src/cheats.cpp index e0c59b4a9..8fff46163 100644 --- a/source/sw/src/cheats.cpp +++ b/source/sw/src/cheats.cpp @@ -49,6 +49,7 @@ bool CheatInputMode = false; bool EveryCheat = false; bool mapcheat = false; extern bool FAF_DebugView; +extern bool ToggleFlyMode; const char *CheatKeyType; void KeysCheat(PLAYERp pp, const char *cheat_string); @@ -88,6 +89,10 @@ const char *GameInterface::GenericCheat(int player, int cheat) Player[player].Flags ^= PF_CLIP_CHEAT; return GStrings(Player[player].Flags & PF_CLIP_CHEAT ? "CLIPPING: OFF" : "CLIPPING: ON"); + case CHT_FLY: + ToggleFlyMode = true; + return nullptr; + default: return nullptr; } diff --git a/source/sw/src/player.cpp b/source/sw/src/player.cpp index 24234708e..147139670 100644 --- a/source/sw/src/player.cpp +++ b/source/sw/src/player.cpp @@ -118,6 +118,8 @@ extern int FinishAnim; char PlayerGravity = PLAYER_JUMP_GRAV; #endif +bool ToggleFlyMode = false; + extern bool DebugOperate; //unsigned char synctics, lastsynctics; @@ -3711,19 +3713,10 @@ DoPlayerWadeSuperJump(PLAYERp pp) bool PlayerFlyKey(void) { - bool key = false; - - if (!GodMode) + if (!ToggleFlyMode) return false; - -#if 0 - // Cheat or not, this simply won't do. - key = inputState.GetKeyStatus(KEYSC_J); - - if (key) - inputState.ClearKeyStatus(KEYSC_J); -#endif - return key; + ToggleFlyMode = false; + return true; } void