mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-06 18:08:26 +00:00
Added duck status saving to checkpoints. (#401)
Also added stamina saving.
This commit is contained in:
parent
4902098570
commit
cba7578df8
@ -63,6 +63,8 @@ enum
|
||||
iCPMoveType,
|
||||
fCPGravity,
|
||||
fCPSpeed,
|
||||
fCPStamina,
|
||||
bCPDucking,
|
||||
PCHECKPOINTSCACHE_SIZE
|
||||
};
|
||||
|
||||
@ -891,6 +893,8 @@ void ResetCheckpoints(int client)
|
||||
gA_PlayerCheckPointsCache[client][i][iCPMoveType] = MOVETYPE_WALK;
|
||||
gA_PlayerCheckPointsCache[client][i][fCPGravity] = 1.0;
|
||||
gA_PlayerCheckPointsCache[client][i][fCPSpeed] = 1.0;
|
||||
gA_PlayerCheckPointsCache[client][i][fCPStamina] = 1.0;
|
||||
gA_PlayerCheckPointsCache[client][i][bCPDucking] = false;
|
||||
}
|
||||
|
||||
gA_CheckpointsCache[client][iCheckpoints] = 0;
|
||||
@ -1491,6 +1495,8 @@ void SaveCheckpoint(int client, int index)
|
||||
gA_PlayerCheckPointsCache[client][index][iCPMoveType] = GetEntityMoveType(client);
|
||||
gA_PlayerCheckPointsCache[client][index][fCPGravity] = GetEntityGravity(client);
|
||||
gA_PlayerCheckPointsCache[client][index][fCPSpeed] = 1.0;
|
||||
gA_PlayerCheckPointsCache[client][index][fCPStamina] = GetEntPropFloat(client, Prop_Send, "m_flStamina");
|
||||
gA_PlayerCheckPointsCache[client][index][bCPDucking] = (GetClientButtons(client) & IN_DUCK) > 0;
|
||||
|
||||
Shavit_SaveSnapshot(client, gA_CheckpointsSnapshots[client][index]);
|
||||
}
|
||||
@ -1502,11 +1508,20 @@ void TeleportToCheckpoint(int client, int index)
|
||||
return;
|
||||
}
|
||||
|
||||
Shavit_SetPracticeMode(client, true, !Shavit_InsideZone(client, Track_Main, Zone_Start));
|
||||
Shavit_LoadSnapshot(client, gA_CheckpointsSnapshots[client][index]);
|
||||
bool bDucking = (GetClientButtons(client) & IN_DUCK) > 0;
|
||||
|
||||
if(gA_PlayerCheckPointsCache[client][index][bCPDucking] != bDucking)
|
||||
{
|
||||
Shavit_PrintToChat(client, "%T", (bDucking)? "MiscCheckpointsCrouchOff":"MiscCheckpointsCrouchOn", client, gS_ChatStrings[sMessageWarning], gS_ChatStrings[sMessageText]);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
bool bInStart = Shavit_InsideZone(client, Zone_Start, -1);
|
||||
|
||||
Shavit_SetPracticeMode(client, true, !bInStart);
|
||||
Shavit_LoadSnapshot(client, gA_CheckpointsSnapshots[client][index]);
|
||||
|
||||
TeleportEntity(client, gF_Checkpoints[client][index][0],
|
||||
((gI_CheckpointsSettings[client] & CP_ANGLES) > 0)? gF_Checkpoints[client][index][1]:NULL_VECTOR,
|
||||
((gI_CheckpointsSettings[client] & CP_VELOCITY) > 0)? gF_Checkpoints[client][index][2]:NULL_VECTOR);
|
||||
@ -1514,6 +1529,7 @@ void TeleportToCheckpoint(int client, int index)
|
||||
SetEntityMoveType(client, view_as<MoveType>(gA_PlayerCheckPointsCache[client][index][iCPMoveType]));
|
||||
SetEntityGravity(client, view_as<float>(gA_PlayerCheckPointsCache[client][index][fCPGravity]));
|
||||
SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", view_as<float>(gA_PlayerCheckPointsCache[client][index][fCPSpeed]));
|
||||
SetEntPropFloat(client, Prop_Send, "m_flStamina", view_as<float>(gA_PlayerCheckPointsCache[client][index][fCPStamina]));
|
||||
|
||||
if(bInStart)
|
||||
{
|
||||
|
||||
@ -78,6 +78,16 @@
|
||||
"#format" "{1:d},{2:s},{3:s}"
|
||||
"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 ---------- //
|
||||
"TeleportMenuTitle"
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user