Merge pull request #767 from shavitush/very_good_yes

hotfix
This commit is contained in:
shavit 2019-03-29 08:43:03 +03:00 committed by GitHub
commit c631f2f549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 2 deletions

View File

@ -23,7 +23,7 @@
#endif
#define _shavit_included
#define SHAVIT_VERSION "2.5.0"
#define SHAVIT_VERSION "2.5.1"
#define STYLE_LIMIT 256
#define MAX_ZONES 64
#define MAX_NAME_LENGTH_SQL 32

View File

@ -86,6 +86,7 @@ enum struct persistent_data_t
int iTargetname;
int iClassname;
ArrayList aFrames;
bool bPractice;
}
// game specific
@ -1116,6 +1117,7 @@ void PersistData(int client)
aData.iMoveType = GetEntityMoveType(client);
aData.fGravity = GetEntityGravity(client);
aData.fSpeed = GetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue");
aData.bPractice = Shavit_IsPracticeMode(client);
float fPosition[3];
GetClientAbsOrigin(client, fPosition);
@ -1224,12 +1226,17 @@ public Action Timer_LoadPersistentData(Handle Timer, any data)
SetEntPropString(client, Prop_Data, "m_iClassname", sClassname);
}
TeleportEntity(client, fPosition, fAngles, view_as<float>({ 0.0, 0.0, 0.0 }));
if(gB_Replay && aData.aFrames != null)
{
Shavit_SetReplayData(client, aData.aFrames);
}
TeleportEntity(client, fPosition, fAngles, view_as<float>({ 0.0, 0.0, 0.0 }));
if(aData.bPractice)
{
Shavit_SetPracticeMode(client, true, false);
}
delete aData.aFrames;
gA_PersistentData.Erase(iIndex);