From 84cb7b98cdef16582ad2b6b9dc985a65b87d6025 Mon Sep 17 00:00:00 2001 From: rtldg <55846624+rtldg@users.noreply.github.com> Date: Sat, 5 Jun 2021 22:33:17 +0000 Subject: [PATCH] misc --- README.md | 2 ++ addons/sourcemod/scripting/shavit-misc.sp | 16 +++++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 8923d2de..311f3aad 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ Refer to the [wiki page](https://github.com/shavitush/bhoptimer/wiki/1.-Installa - Jump HUD for bhoptimer. !jhud for settings. * [shavit-firstjumptick](https://github.com/Nairdaa/bhoptimer-firstjumptick) - Displays what tick the player first jumps at upon leaving the startzone. Very useful for strafe maps, where you tryhard to cut that tick or two. !fjt to enable. +* [sm_closestpos](https://github.com/rtldg/sm_closestpos) + - C++ extension to more efficiently find the closest node to a given position. Used to calculate time-difference and velocity-difference from replays. * TODO: `paint`, `mpbhops`, `ljstats`, `bash2` ### CS:GO diff --git a/addons/sourcemod/scripting/shavit-misc.sp b/addons/sourcemod/scripting/shavit-misc.sp index 2ea7307b..1fb38f2c 100644 --- a/addons/sourcemod/scripting/shavit-misc.sp +++ b/addons/sourcemod/scripting/shavit-misc.sp @@ -1418,7 +1418,7 @@ void PersistData(int client, bool disconnected) } else { - gA_PersistentData.SetArray(iIndex, aData, sizeof(aData)); + gA_PersistentData.SetArray(iIndex, aData); } } @@ -2442,9 +2442,6 @@ void SaveCheckpointCache(int target, cp_cache_t cpcache, bool isPersistentData) cpcache.fGravity = GetEntityGravity(target); cpcache.fSpeed = GetEntPropFloat(target, Prop_Send, "m_flLaggedMovementValue"); - int iFlags = GetEntityFlags(target); - iFlags &= ~(FL_ATCONTROLS|FL_FAKECLIENT); - if(IsFakeClient(target)) { cpcache.iGroundEntity = -1; @@ -2457,7 +2454,7 @@ void SaveCheckpointCache(int target, cp_cache_t cpcache, bool isPersistentData) GetEntPropString(target, Prop_Data, "m_iName", cpcache.sTargetname, 64); } - cpcache.iFlags = iFlags; + cpcache.iFlags = GetEntityFlags(target) & ~(FL_ATCONTROLS|FL_FAKECLIENT); if(gEV_Type != Engine_TF2) { @@ -2601,9 +2598,7 @@ void TeleportToCheckpoint(int client, int index, bool suppressMessage) void LoadCheckpointCache(int client, cp_cache_t cpcache, bool isPersistentData) { - MoveType mt = cpcache.iMoveType; - - SetEntityMoveType(client, mt); + SetEntityMoveType(client, cpcache.iMoveType); SetEntityFlags(client, cpcache.iFlags); SetEntPropFloat(client, Prop_Send, "m_flLaggedMovementValue", cpcache.fSpeed); SetEntPropEnt(client, Prop_Data, "m_hGroundEntity", cpcache.iGroundEntity); @@ -2620,7 +2615,6 @@ void LoadCheckpointCache(int client, cp_cache_t cpcache, bool isPersistentData) { SetEntPropFloat(client, Prop_Send, "m_flDucktime", cpcache.fDucktime); } - else if(gEV_Type == Engine_CSGO) { SetEntPropFloat(client, Prop_Send, "m_flDuckAmount", cpcache.fDucktime); @@ -3129,7 +3123,7 @@ public void Player_Spawn(Event event, const char[] name, bool dontBroadcast) { if(gCV_RestoreStates.BoolValue) { - RequestFrame(LoadPersistentData, serial); + LoadPersistentData(serial); bCanStartOnSpawn = false; } } @@ -3141,7 +3135,7 @@ public void Player_Spawn(Event event, const char[] name, bool dontBroadcast) if (iIndex != -1) { gB_SaveStates[client] = true; - RequestFrame(LoadPersistentData, serial); + LoadPersistentData(serial); bCanStartOnSpawn = false; } }