mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
Revert "shavit_misc_staticprestrafe -> shavit_core_staticprestrafe"
This reverts commit c4783eae37.
This commit is contained in:
parent
a79016397a
commit
7ca35b908b
@ -54,7 +54,6 @@ EngineVersion gEV_Type = Engine_Unknown;
|
|||||||
bool gB_Protobuf = false;
|
bool gB_Protobuf = false;
|
||||||
|
|
||||||
// hook stuff
|
// hook stuff
|
||||||
DynamicHook gH_GetPlayerMaxSpeed = null;
|
|
||||||
DynamicHook gH_AcceptInput; // used for hooking player_speedmod's AcceptInput
|
DynamicHook gH_AcceptInput; // used for hooking player_speedmod's AcceptInput
|
||||||
|
|
||||||
// database handle
|
// database handle
|
||||||
@ -123,7 +122,6 @@ Convar gCV_VelocityTeleport = null;
|
|||||||
Convar gCV_DefaultStyle = null;
|
Convar gCV_DefaultStyle = null;
|
||||||
Convar gCV_NoChatSound = null;
|
Convar gCV_NoChatSound = null;
|
||||||
Convar gCV_SimplerLadders = null;
|
Convar gCV_SimplerLadders = null;
|
||||||
Convar gCV_StaticPrestrafe = null;
|
|
||||||
Convar gCV_UseOffsets = null;
|
Convar gCV_UseOffsets = null;
|
||||||
Convar gCV_TimeInMessages;
|
Convar gCV_TimeInMessages;
|
||||||
Convar gCV_DebugOffsets = null;
|
Convar gCV_DebugOffsets = null;
|
||||||
@ -346,7 +344,6 @@ public void OnPluginStart()
|
|||||||
gCV_NoChatSound = new Convar("shavit_core_nochatsound", "0", "Disables click sound for chat messages.", 0, true, 0.0, true, 1.0);
|
gCV_NoChatSound = new Convar("shavit_core_nochatsound", "0", "Disables click sound for chat messages.", 0, true, 0.0, true, 1.0);
|
||||||
gCV_SimplerLadders = new Convar("shavit_core_simplerladders", "1", "Allows using all keys on limited styles (such as sideways) after touching ladders\nTouching the ground enables the restriction again.", 0, true, 0.0, true, 1.0);
|
gCV_SimplerLadders = new Convar("shavit_core_simplerladders", "1", "Allows using all keys on limited styles (such as sideways) after touching ladders\nTouching the ground enables the restriction again.", 0, true, 0.0, true, 1.0);
|
||||||
gCV_UseOffsets = new Convar("shavit_core_useoffsets", "1", "Calculates more accurate times by subtracting/adding tick offsets from the time the server uses to register that a player has left or entered a trigger", 0, true, 0.0, true, 1.0);
|
gCV_UseOffsets = new Convar("shavit_core_useoffsets", "1", "Calculates more accurate times by subtracting/adding tick offsets from the time the server uses to register that a player has left or entered a trigger", 0, true, 0.0, true, 1.0);
|
||||||
gCV_StaticPrestrafe = new Convar("shavit_core_staticprestrafe", "1", "Force prestrafe for every pistol.\n250 is the default value and some styles will have 260.\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
|
|
||||||
gCV_TimeInMessages = new Convar("shavit_core_timeinmessages", "0", "Whether to prefix SayText2 messages with the time.", 0, true, 0.0, true, 1.0);
|
gCV_TimeInMessages = new Convar("shavit_core_timeinmessages", "0", "Whether to prefix SayText2 messages with the time.", 0, true, 0.0, true, 1.0);
|
||||||
gCV_DebugOffsets = new Convar("shavit_core_debugoffsets", "0", "Print offset upon leaving or entering a zone?", 0, true, 0.0, true, 1.0);
|
gCV_DebugOffsets = new Convar("shavit_core_debugoffsets", "0", "Print offset upon leaving or entering a zone?", 0, true, 0.0, true, 1.0);
|
||||||
gCV_SaveIps = new Convar("shavit_core_save_ips", "1", "Whether to save player IPs in the 'users' database table. IPs are used to show player location on the !profile menu.\nTurning this on will not wipe existing IPs from the 'users' table.", 0, true, 0.0, true, 1.0);
|
gCV_SaveIps = new Convar("shavit_core_save_ips", "1", "Whether to save player IPs in the 'users' database table. IPs are used to show player location on the !profile menu.\nTurning this on will not wipe existing IPs from the 'users' table.", 0, true, 0.0, true, 1.0);
|
||||||
@ -445,18 +442,6 @@ void LoadDHooks()
|
|||||||
|
|
||||||
LoadPhysicsUntouch(gamedataConf);
|
LoadPhysicsUntouch(gamedataConf);
|
||||||
|
|
||||||
if (gEV_Type != Engine_TF2)
|
|
||||||
{
|
|
||||||
int iOffset;
|
|
||||||
|
|
||||||
if ((iOffset = GameConfGetOffset(gamedataConf, "CCSPlayer::GetPlayerMaxSpeed")) == -1)
|
|
||||||
{
|
|
||||||
SetFailState("Couldn't get the offset for \"CCSPlayer::GetPlayerMaxSpeed\" - make sure your gamedata is updated!");
|
|
||||||
}
|
|
||||||
|
|
||||||
gH_GetPlayerMaxSpeed = new DynamicHook(iOffset, HookType_Entity, ReturnType_Float, ThisPointer_CBaseEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete CreateInterface;
|
delete CreateInterface;
|
||||||
delete gamedataConf;
|
delete gamedataConf;
|
||||||
|
|
||||||
@ -2285,11 +2270,6 @@ public void OnClientPutInServer(int client)
|
|||||||
SDKHook(client, SDKHook_PreThinkPost, PreThinkPost);
|
SDKHook(client, SDKHook_PreThinkPost, PreThinkPost);
|
||||||
SDKHook(client, SDKHook_PostThinkPost, PostThinkPost);
|
SDKHook(client, SDKHook_PostThinkPost, PostThinkPost);
|
||||||
|
|
||||||
if (gEV_Type != Engine_TF2)
|
|
||||||
{
|
|
||||||
gH_GetPlayerMaxSpeed.HookEntity(Hook_Post, client, CCSPlayer__GetPlayerMaxSpeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
int iSteamID = GetSteamAccountID(client);
|
int iSteamID = GetSteamAccountID(client);
|
||||||
|
|
||||||
if(iSteamID == 0)
|
if(iSteamID == 0)
|
||||||
@ -2443,48 +2423,10 @@ public void Shavit_OnLeaveZone(int client, int type, int track, int id, int enti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public MRESReturn CCSPlayer__GetPlayerMaxSpeed(int pThis, DHookReturn hReturn)
|
|
||||||
{
|
|
||||||
if (!gCV_StaticPrestrafe.BoolValue || !IsValidClient(pThis, true))
|
|
||||||
{
|
|
||||||
return MRES_Ignored;
|
|
||||||
}
|
|
||||||
|
|
||||||
hReturn.Value = GetStyleSettingFloat(gA_Timers[pThis].bsStyle, "runspeed");
|
|
||||||
|
|
||||||
return MRES_Override;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TF2_MaxSpeedStuff(int client)
|
|
||||||
{
|
|
||||||
float maxspeed;
|
|
||||||
|
|
||||||
if (GetEntityFlags(client) & FL_ONGROUND)
|
|
||||||
{
|
|
||||||
maxspeed = GetStyleSettingFloat(gA_Timers[client].bsStyle, "runspeed");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// This is used to stop CTFGameMovement::PreventBunnyJumping from destroying
|
|
||||||
// player velocity when doing uncrouch stuff. Kind of poopy.
|
|
||||||
float fSpeed[3];
|
|
||||||
GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", fSpeed);
|
|
||||||
maxspeed = GetVectorLength(fSpeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
// not the best method, but only one i found for tf2
|
|
||||||
SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", maxspeed);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void PreThinkPost(int client)
|
public void PreThinkPost(int client)
|
||||||
{
|
{
|
||||||
if(IsPlayerAlive(client))
|
if(IsPlayerAlive(client))
|
||||||
{
|
{
|
||||||
if (gEV_Type == Engine_TF2)
|
|
||||||
{
|
|
||||||
TF2_MaxSpeedStuff(client);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!gB_Zones || !Shavit_InsideZone(client, Zone_Airaccelerate, -1))
|
if(!gB_Zones || !Shavit_InsideZone(client, Zone_Airaccelerate, -1))
|
||||||
{
|
{
|
||||||
sv_airaccelerate.FloatValue = GetStyleSettingFloat(gA_Timers[client].bsStyle, "airaccelerate");
|
sv_airaccelerate.FloatValue = GetStyleSettingFloat(gA_Timers[client].bsStyle, "airaccelerate");
|
||||||
|
|||||||
@ -94,6 +94,7 @@ Convar gCV_DisableRadio = null;
|
|||||||
Convar gCV_Scoreboard = null;
|
Convar gCV_Scoreboard = null;
|
||||||
Convar gCV_WeaponCommands = null;
|
Convar gCV_WeaponCommands = null;
|
||||||
Convar gCV_PlayerOpacity = null;
|
Convar gCV_PlayerOpacity = null;
|
||||||
|
Convar gCV_StaticPrestrafe = null;
|
||||||
Convar gCV_NoclipMe = null;
|
Convar gCV_NoclipMe = null;
|
||||||
Convar gCV_AdvertisementInterval = null;
|
Convar gCV_AdvertisementInterval = null;
|
||||||
Convar gCV_RemoveRagdolls = null;
|
Convar gCV_RemoveRagdolls = null;
|
||||||
@ -127,6 +128,7 @@ Handle gH_Forwards_OnClanTagChangePre = null;
|
|||||||
Handle gH_Forwards_OnClanTagChangePost = null;
|
Handle gH_Forwards_OnClanTagChangePost = null;
|
||||||
|
|
||||||
// dhooks
|
// dhooks
|
||||||
|
DynamicHook gH_GetPlayerMaxSpeed = null;
|
||||||
DynamicHook gH_IsSpawnPointValid = null;
|
DynamicHook gH_IsSpawnPointValid = null;
|
||||||
DynamicDetour gH_CalcPlayerScore = null;
|
DynamicDetour gH_CalcPlayerScore = null;
|
||||||
|
|
||||||
@ -263,6 +265,7 @@ public void OnPluginStart()
|
|||||||
gCV_Scoreboard = new Convar("shavit_misc_scoreboard", "1", "Manipulate scoreboard so score is -{time} and deaths are {rank})?\nDeaths part requires shavit-rankings.\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
|
gCV_Scoreboard = new Convar("shavit_misc_scoreboard", "1", "Manipulate scoreboard so score is -{time} and deaths are {rank})?\nDeaths part requires shavit-rankings.\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
|
||||||
gCV_WeaponCommands = new Convar("shavit_misc_weaponcommands", "2", "Enable sm_usp, sm_glock and sm_knife?\n0 - Disabled\n1 - Enabled\n2 - Also give infinite reserved ammo.\n3 - Also give infinite clip ammo.", 0, true, 0.0, true, 3.0);
|
gCV_WeaponCommands = new Convar("shavit_misc_weaponcommands", "2", "Enable sm_usp, sm_glock and sm_knife?\n0 - Disabled\n1 - Enabled\n2 - Also give infinite reserved ammo.\n3 - Also give infinite clip ammo.", 0, true, 0.0, true, 3.0);
|
||||||
gCV_PlayerOpacity = new Convar("shavit_misc_playeropacity", "69", "Player opacity (alpha) to set on spawn.\n-1 - Disabled\nValue can go up to 255. 0 for invisibility.", 0, true, -1.0, true, 255.0);
|
gCV_PlayerOpacity = new Convar("shavit_misc_playeropacity", "69", "Player opacity (alpha) to set on spawn.\n-1 - Disabled\nValue can go up to 255. 0 for invisibility.", 0, true, -1.0, true, 255.0);
|
||||||
|
gCV_StaticPrestrafe = new Convar("shavit_misc_staticprestrafe", "1", "Force prestrafe for every pistol.\n250 is the default value and some styles will have 260.\n0 - Disabled\n1 - Enabled", 0, true, 0.0, true, 1.0);
|
||||||
gCV_NoclipMe = new Convar("shavit_misc_noclipme", "1", "Allow +noclip, sm_p and all the noclip commands?\n0 - Disabled\n1 - Enabled\n2 - requires 'admin_noclipme' override or ADMFLAG_CHEATS flag.", 0, true, 0.0, true, 2.0);
|
gCV_NoclipMe = new Convar("shavit_misc_noclipme", "1", "Allow +noclip, sm_p and all the noclip commands?\n0 - Disabled\n1 - Enabled\n2 - requires 'admin_noclipme' override or ADMFLAG_CHEATS flag.", 0, true, 0.0, true, 2.0);
|
||||||
gCV_AdvertisementInterval = new Convar("shavit_misc_advertisementinterval", "600.0", "Interval between each chat advertisement.\nConfiguration file for those is configs/shavit-advertisements.cfg.\nSet to 0.0 to disable.\nRequires server restart for changes to take effect.", 0, true, 0.0);
|
gCV_AdvertisementInterval = new Convar("shavit_misc_advertisementinterval", "600.0", "Interval between each chat advertisement.\nConfiguration file for those is configs/shavit-advertisements.cfg.\nSet to 0.0 to disable.\nRequires server restart for changes to take effect.", 0, true, 0.0);
|
||||||
gCV_RemoveRagdolls = new Convar("shavit_misc_removeragdolls", "1", "Remove ragdolls after death?\n0 - Disabled\n1 - Only remove replay bot ragdolls.\n2 - Remove all ragdolls.", 0, true, 0.0, true, 2.0);
|
gCV_RemoveRagdolls = new Convar("shavit_misc_removeragdolls", "1", "Remove ragdolls after death?\n0 - Disabled\n1 - Only remove replay bot ragdolls.\n2 - Remove all ragdolls.", 0, true, 0.0, true, 2.0);
|
||||||
@ -341,6 +344,15 @@ void LoadDHooks()
|
|||||||
LogError("Couldn't get the address for \"CTFGameRules::CalcPlayerScore\" - make sure your gamedata is updated!");
|
LogError("Couldn't get the address for \"CTFGameRules::CalcPlayerScore\" - make sure your gamedata is updated!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((iOffset = GameConfGetOffset(hGameData, "CCSPlayer::GetPlayerMaxSpeed")) == -1)
|
||||||
|
{
|
||||||
|
SetFailState("Couldn't get the offset for \"CCSPlayer::GetPlayerMaxSpeed\" - make sure your gamedata is updated!");
|
||||||
|
}
|
||||||
|
|
||||||
|
gH_GetPlayerMaxSpeed = DHookCreate(iOffset, HookType_Entity, ReturnType_Float, ThisPointer_CBaseEntity, CCSPlayer__GetPlayerMaxSpeed);
|
||||||
|
}
|
||||||
|
|
||||||
if ((iOffset = GameConfGetOffset(hGameData, "CGameRules::IsSpawnPointValid")) != -1)
|
if ((iOffset = GameConfGetOffset(hGameData, "CGameRules::IsSpawnPointValid")) != -1)
|
||||||
{
|
{
|
||||||
@ -908,6 +920,18 @@ public Action Command_Radio(int client, const char[] command, int args)
|
|||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public MRESReturn CCSPlayer__GetPlayerMaxSpeed(int pThis, DHookReturn hReturn)
|
||||||
|
{
|
||||||
|
if(!gCV_StaticPrestrafe.BoolValue || !IsValidClient(pThis, true))
|
||||||
|
{
|
||||||
|
return MRES_Ignored;
|
||||||
|
}
|
||||||
|
|
||||||
|
hReturn.Value = Shavit_GetStyleSettingFloat(gI_Style[pThis], "runspeed");
|
||||||
|
|
||||||
|
return MRES_Override;
|
||||||
|
}
|
||||||
|
|
||||||
public Action Timer_Cron(Handle timer)
|
public Action Timer_Cron(Handle timer)
|
||||||
{
|
{
|
||||||
if(gCV_HideRadar.BoolValue && gEV_Type == Engine_CSS)
|
if(gCV_HideRadar.BoolValue && gEV_Type == Engine_CSS)
|
||||||
@ -1263,6 +1287,18 @@ public void OnClientPutInServer(int client)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(gEV_Type == Engine_TF2)
|
||||||
|
{
|
||||||
|
SDKHook(client, SDKHook_PreThinkPost, TF2_OnPreThink);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(gH_GetPlayerMaxSpeed != null)
|
||||||
|
{
|
||||||
|
DHookEntity(gH_GetPlayerMaxSpeed, true, client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!AreClientCookiesCached(client))
|
if(!AreClientCookiesCached(client))
|
||||||
{
|
{
|
||||||
gI_Style[client] = Shavit_GetBhopStyle(client);
|
gI_Style[client] = Shavit_GetBhopStyle(client);
|
||||||
@ -1380,6 +1416,30 @@ public Action OnSetTransmit(int entity, int client)
|
|||||||
return Plugin_Continue;
|
return Plugin_Continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void TF2_OnPreThink(int client)
|
||||||
|
{
|
||||||
|
if(IsPlayerAlive(client))
|
||||||
|
{
|
||||||
|
float maxspeed;
|
||||||
|
|
||||||
|
if (GetEntityFlags(client) & FL_ONGROUND)
|
||||||
|
{
|
||||||
|
maxspeed = Shavit_GetStyleSettingFloat(gI_Style[client], "runspeed");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This is used to stop CTFGameMovement::PreventBunnyJumping from destroying
|
||||||
|
// player velocity when doing uncrouch stuff. Kind of poopy.
|
||||||
|
float fSpeed[3];
|
||||||
|
GetEntPropVector(client, Prop_Data, "m_vecAbsVelocity", fSpeed);
|
||||||
|
maxspeed = GetVectorLength(fSpeed);
|
||||||
|
}
|
||||||
|
|
||||||
|
// not the best method, but only one i found for tf2
|
||||||
|
SetEntPropFloat(client, Prop_Send, "m_flMaxspeed", maxspeed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
|
public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs)
|
||||||
{
|
{
|
||||||
if (!IsValidClient(client))
|
if (!IsValidClient(client))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user