mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-10 11:58:27 +00:00
fix the player_speedmod button disable flags not working (for things like bhop_futile)
This commit is contained in:
parent
51427be3e9
commit
1802dd8007
@ -154,6 +154,9 @@ bool gB_CookiesRetrieved[MAXPLAYERS+1];
|
|||||||
float gF_ZoneAiraccelerate[MAXPLAYERS+1];
|
float gF_ZoneAiraccelerate[MAXPLAYERS+1];
|
||||||
float gF_ZoneSpeedLimit[MAXPLAYERS+1];
|
float gF_ZoneSpeedLimit[MAXPLAYERS+1];
|
||||||
|
|
||||||
|
float gF_SpeedModGarbage;
|
||||||
|
int gI_SpeedModGarbage = 0;
|
||||||
|
|
||||||
// kz support
|
// kz support
|
||||||
bool gB_KZMap[TRACKS_SIZE];
|
bool gB_KZMap[TRACKS_SIZE];
|
||||||
|
|
||||||
@ -542,6 +545,9 @@ public void OnLibraryRemoved(const char[] name)
|
|||||||
|
|
||||||
public void OnMapStart()
|
public void OnMapStart()
|
||||||
{
|
{
|
||||||
|
gF_SpeedModGarbage = 0.0;
|
||||||
|
gI_SpeedModGarbage = 0;
|
||||||
|
|
||||||
// styles
|
// styles
|
||||||
if(!LoadStyles())
|
if(!LoadStyles())
|
||||||
{
|
{
|
||||||
@ -2549,6 +2555,7 @@ public void OnEntityCreated(int entity, const char[] classname)
|
|||||||
if (StrEqual(classname, "player_speedmod"))
|
if (StrEqual(classname, "player_speedmod"))
|
||||||
{
|
{
|
||||||
gH_AcceptInput.HookEntity(Hook_Pre, entity, DHook_AcceptInput_player_speedmod);
|
gH_AcceptInput.HookEntity(Hook_Pre, entity, DHook_AcceptInput_player_speedmod);
|
||||||
|
gH_AcceptInput.HookEntity(Hook_Post, entity, DHook_AcceptInput_player_speedmod_Post);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2576,15 +2583,28 @@ public MRESReturn DHook_AcceptInput_player_speedmod(int pThis, DHookReturn hRetu
|
|||||||
int style = gA_Timers[activator].bsStyle;
|
int style = gA_Timers[activator].bsStyle;
|
||||||
|
|
||||||
speed *= gA_Timers[activator].fTimescale * GetStyleSettingFloat(style, "speed");
|
speed *= gA_Timers[activator].fTimescale * GetStyleSettingFloat(style, "speed");
|
||||||
SetEntPropFloat(activator, Prop_Data, "m_flLaggedMovementValue", speed);
|
gF_SpeedModGarbage = speed;
|
||||||
|
gI_SpeedModGarbage = activator;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
int caller = hParams.Get(3);
|
int caller = hParams.Get(3);
|
||||||
PrintToServer("ModifySpeed activator = %d(%N), caller = %d, old_speed = %s, new_speed = %f", activator, activator, caller, buf, speed);
|
PrintToServer("ModifySpeed activator = %d(%N), caller = %d, old_speed = %s, new_speed = %f", activator, activator, caller, buf, speed);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hReturn.Value = true;
|
return MRES_Ignored;
|
||||||
return MRES_Supercede;
|
}
|
||||||
|
|
||||||
|
// bool CBaseEntity::AcceptInput(char const*, CBaseEntity*, CBaseEntity*, variant_t, int)
|
||||||
|
public MRESReturn DHook_AcceptInput_player_speedmod_Post(int pThis, DHookReturn hReturn, DHookParam hParams)
|
||||||
|
{
|
||||||
|
if (gI_SpeedModGarbage)
|
||||||
|
{
|
||||||
|
SetEntPropFloat(gI_SpeedModGarbage, Prop_Data, "m_flLaggedMovementValue", gF_SpeedModGarbage);
|
||||||
|
gI_SpeedModGarbage = 0;
|
||||||
|
gF_SpeedModGarbage = 0.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MRES_Ignored;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MRESReturn DHook_ProcessMovement(Handle hParams)
|
public MRESReturn DHook_ProcessMovement(Handle hParams)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user