mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 02:18:26 +00:00
Fixed teleporting to ducked CPs in both CS:S/CS:GO.
This commit is contained in:
parent
29df19b1b3
commit
7ff9f4e2a8
@ -45,8 +45,8 @@ enum CheckpointsCache
|
|||||||
Float:fCPStamina,
|
Float:fCPStamina,
|
||||||
bool:bCPDucked,
|
bool:bCPDucked,
|
||||||
bool:bCPDucking,
|
bool:bCPDucking,
|
||||||
Float:fCPDucktime,
|
Float:fCPDucktime, // m_flDuckAmount in csgo
|
||||||
bool:bCPDuckButton,
|
Float:fCPDuckSpeed, // m_flDuckSpeed in csgo, doesn't exist in css
|
||||||
iCPFlags,
|
iCPFlags,
|
||||||
any:aCPSnapshot[TIMERSNAPSHOT_SIZE],
|
any:aCPSnapshot[TIMERSNAPSHOT_SIZE],
|
||||||
String:sCPTargetname[32],
|
String:sCPTargetname[32],
|
||||||
@ -1680,10 +1680,8 @@ bool SaveCheckpoint(int client, int index)
|
|||||||
cpcache[fCPGravity] = GetEntityGravity(target);
|
cpcache[fCPGravity] = GetEntityGravity(target);
|
||||||
cpcache[fCPSpeed] = GetEntPropFloat(target, Prop_Send, "m_flLaggedMovementValue");
|
cpcache[fCPSpeed] = GetEntPropFloat(target, Prop_Send, "m_flLaggedMovementValue");
|
||||||
cpcache[fCPStamina] = (gEV_Type != Engine_TF2)? GetEntPropFloat(target, Prop_Send, "m_flStamina"):0.0;
|
cpcache[fCPStamina] = (gEV_Type != Engine_TF2)? GetEntPropFloat(target, Prop_Send, "m_flStamina"):0.0;
|
||||||
cpcache[bCPDuckButton] = (GetClientButtons(target) & IN_DUCK) > 0;
|
|
||||||
cpcache[iCPFlags] = GetEntityFlags(target);
|
cpcache[iCPFlags] = GetEntityFlags(target);
|
||||||
|
|
||||||
// TODO: CS:GO version of this
|
|
||||||
if(gEV_Type == Engine_CSS)
|
if(gEV_Type == Engine_CSS)
|
||||||
{
|
{
|
||||||
cpcache[bCPDucked] = view_as<bool>(GetEntProp(target, Prop_Send, "m_bDucked"));
|
cpcache[bCPDucked] = view_as<bool>(GetEntProp(target, Prop_Send, "m_bDucked"));
|
||||||
@ -1691,6 +1689,12 @@ bool SaveCheckpoint(int client, int index)
|
|||||||
cpcache[fCPDucktime] = GetEntPropFloat(target, Prop_Send, "m_flDucktime");
|
cpcache[fCPDucktime] = GetEntPropFloat(target, Prop_Send, "m_flDucktime");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(gEV_Type == Engine_CSGO)
|
||||||
|
{
|
||||||
|
cpcache[fCPDucktime] = GetEntPropFloat(target, Prop_Send, "m_flDuckAmount");
|
||||||
|
cpcache[fCPDuckSpeed] = GetEntPropFloat(target, Prop_Send, "m_flDuckSpeed");
|
||||||
|
}
|
||||||
|
|
||||||
any snapshot[TIMERSNAPSHOT_SIZE];
|
any snapshot[TIMERSNAPSHOT_SIZE];
|
||||||
|
|
||||||
if(IsFakeClient(target))
|
if(IsFakeClient(target))
|
||||||
@ -1761,15 +1765,6 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bDucking = (GetClientButtons(client) & IN_DUCK) > 0;
|
|
||||||
|
|
||||||
if(cpcache[bCPDuckButton] != bDucking)
|
|
||||||
{
|
|
||||||
Shavit_PrintToChat(client, "%T", (bDucking)? "MiscCheckpointsCrouchOff":"MiscCheckpointsCrouchOn", client, gS_ChatStrings[sMessageWarning], gS_ChatStrings[sMessageText]);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool bInStart = Shavit_InsideZone(client, Zone_Start, -1);
|
bool bInStart = Shavit_InsideZone(client, Zone_Start, -1);
|
||||||
|
|
||||||
if(bInStart)
|
if(bInStart)
|
||||||
@ -1811,7 +1806,6 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage)
|
|||||||
SetEntPropFloat(client, Prop_Send, "m_flStamina", cpcache[fCPStamina]);
|
SetEntPropFloat(client, Prop_Send, "m_flStamina", cpcache[fCPStamina]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: CS:GO version of this
|
|
||||||
if(gEV_Type == Engine_CSS)
|
if(gEV_Type == Engine_CSS)
|
||||||
{
|
{
|
||||||
SetEntProp(client, Prop_Send, "m_bDucked", cpcache[bCPDucked]);
|
SetEntProp(client, Prop_Send, "m_bDucked", cpcache[bCPDucked]);
|
||||||
@ -1819,6 +1813,12 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage)
|
|||||||
SetEntPropFloat(client, Prop_Send, "m_flDucktime", cpcache[fCPDucktime]);
|
SetEntPropFloat(client, Prop_Send, "m_flDucktime", cpcache[fCPDucktime]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if(gEV_Type == Engine_CSGO)
|
||||||
|
{
|
||||||
|
SetEntPropFloat(client, Prop_Send, "m_flDuckAmount", cpcache[fCPDucktime]);
|
||||||
|
SetEntPropFloat(client, Prop_Send, "m_flDuckSpeed", cpcache[fCPDuckSpeed]);
|
||||||
|
}
|
||||||
|
|
||||||
if(!suppressMessage)
|
if(!suppressMessage)
|
||||||
{
|
{
|
||||||
Shavit_PrintToChat(client, "%T", "MiscCheckpointsTeleported", client, (index + 1), gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText]);
|
Shavit_PrintToChat(client, "%T", "MiscCheckpointsTeleported", client, (index + 1), gS_ChatStrings[sMessageVariable], gS_ChatStrings[sMessageText]);
|
||||||
|
|||||||
@ -83,16 +83,6 @@
|
|||||||
"#format" "{1:d},{2:s},{3:s}"
|
"#format" "{1:d},{2:s},{3:s}"
|
||||||
"en" "Checkpoint {1} is {2}empty{3}."
|
"en" "Checkpoint {1} is {2}empty{3}."
|
||||||
}
|
}
|
||||||
"MiscCheckpointsCrouchOn"
|
|
||||||
{
|
|
||||||
"#format" "{1:s},{2:s}"
|
|
||||||
"en" "You must {1}duck{2} while teleporting to this checkpoint."
|
|
||||||
}
|
|
||||||
"MiscCheckpointsCrouchOff"
|
|
||||||
{
|
|
||||||
"#format" "{1:s},{2:s}"
|
|
||||||
"en" "You must {1}stop ducking{2} while teleporting to this checkpoint."
|
|
||||||
}
|
|
||||||
// ---------- Menus ---------- //
|
// ---------- Menus ---------- //
|
||||||
"TeleportMenuTitle"
|
"TeleportMenuTitle"
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user