diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index a476e4b8af..2928568d0d 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -73,6 +73,7 @@ CVAR (Float, movebob, 0.25f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Float, stillbob, 0.f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (Float, wbobspeed, 1.f, CVAR_USERINFO | CVAR_ARCHIVE); CVAR (String, playerclass, "Fighter", CVAR_USERINFO | CVAR_ARCHIVE); +CVAR (Bool, classicflight, false, CVAR_USERINFO | CVAR_ARCHIVE); enum { @@ -88,6 +89,7 @@ enum INFO_WBobSpeed, INFO_PlayerClass, INFO_ColorSet, + INFO_ClassicFlight, }; const char *GenderNames[3] = { "male", "female", "other" }; diff --git a/src/d_player.h b/src/d_player.h index 7d8dbf380c..c8c5b0fc7c 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -330,6 +330,10 @@ struct userinfo_t : TMap { return *static_cast(*CheckKey(NAME_PlayerClass)); } + bool GetClassicFlight() const + { + return *static_cast(*CheckKey(NAME_ClassicFlight)); + } PClassActor *GetPlayerClassType() const { return PlayerClasses[GetPlayerClassNum()].Type; diff --git a/src/namedef.h b/src/namedef.h index 5ba5bafd17..054c53e492 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -768,6 +768,7 @@ xx(ColorSet) xx(NeverSwitchOnPickup) xx(MoveBob) xx(StillBob) +xx(ClassicFlight) xx(WBobSpeed) xx(PlayerClass) xx(MonsterClass) diff --git a/src/p_user.cpp b/src/p_user.cpp index 5208616519..d622827bae 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -813,6 +813,12 @@ DEFINE_ACTION_FUNCTION(_PlayerInfo, GetNeverSwitch) ACTION_RETURN_BOOL(self->userinfo.GetNeverSwitch()); } +DEFINE_ACTION_FUNCTION(_PlayerInfo, GetClassicFlight) +{ + PARAM_SELF_STRUCT_PROLOGUE(player_t); + ACTION_RETURN_BOOL(self->userinfo.GetClassicFlight()); +} + DEFINE_ACTION_FUNCTION(_PlayerInfo, GetColor) { PARAM_SELF_STRUCT_PROLOGUE(player_t); diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index 8b8710416a..d43a59ce27 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -746,7 +746,7 @@ class PlayerPawn : Actor native void ForwardThrust (double move, double angle) { - if ((waterlevel || bNoGravity) && Pitch != 0) + if ((waterlevel || bNoGravity) && Pitch != 0 && !player.GetClassicFlight()) { double zpush = move * sin(Pitch); if (waterlevel && waterlevel < 2 && zpush < 0) zpush = 0; @@ -1484,6 +1484,7 @@ struct PlayerInfo native play // this is what internally is known as player_t native float GetAutoaim() const; native bool GetNoAutostartMap() const; native void SetFOV(float fov); + native bool GetClassicFlight() const; native clearscope bool HasWeaponsInSlot(int slot) const; bool IsTotallyFrozen()