@@ -127,6 +127,8 @@ enum VScript_Checkpoint_State
127127}
128128VScript_Checkpoint_State gI_VScript_Checkpointing [MAXPLAYERS +1 ];
129129StringMap gH_VScript_Checkpoint_CustomData [MAXPLAYERS +1 ];
130+ // Caching this makes me happy
131+ HSCRIPT gH_PlayerHSCRIPT [MAXPLAYERS +1 ];
130132
131133
132134public Plugin myinfo =
@@ -513,6 +515,11 @@ public void OnClientPutInServer(int client)
513515{
514516 gF_NextSuicide [client ] = GetGameTime ();
515517
518+ if (gB_VScript )
519+ {
520+ gH_PlayerHSCRIPT [client ] = VScript_EntityToHScript (client );
521+ }
522+
516523 if (IsFakeClient (client ))
517524 {
518525 return ;
@@ -1793,7 +1800,7 @@ void SaveCheckpointCache(int saver, int target, cp_cache_t cpcache, int index, H
17931800 {
17941801 // ::Timer_OnCheckpointSave <- function(player)
17951802 VScriptExecute Timer_OnCheckpointSave = new VScriptExecute (HSCRIPT_RootTable .GetValue (" Timer_OnCheckpointSave" ));
1796- Timer_OnCheckpointSave .SetParam (1 , FIELD_HSCRIPT , VScript_EntityToHScript ( target ) );
1803+ Timer_OnCheckpointSave .SetParam (1 , FIELD_HSCRIPT , gH_PlayerHSCRIPT [ target ] );
17971804 Timer_OnCheckpointSave .Execute ();
17981805 delete Timer_OnCheckpointSave ;
17991806 }
@@ -1907,7 +1914,7 @@ bool LoadCheckpointCache(int client, cp_cache_t cpcache, int index, bool force =
19071914 {
19081915 // ::Timer_OnCheckpointLoadPre <- function(player)
19091916 VScriptExecute Timer_OnCheckpointLoadPre = new VScriptExecute (HSCRIPT_RootTable .GetValue (" Timer_OnCheckpointLoadPre" ));
1910- Timer_OnCheckpointLoadPre .SetParam (1 , FIELD_HSCRIPT , VScript_EntityToHScript ( client ) );
1917+ Timer_OnCheckpointLoadPre .SetParam (1 , FIELD_HSCRIPT , gH_PlayerHSCRIPT [ client ] );
19111918 Timer_OnCheckpointLoadPre .Execute ();
19121919 delete Timer_OnCheckpointLoadPre ;
19131920 }
@@ -2403,7 +2410,7 @@ void Do_Timer_OnCheckpointLoadPost(int client, StringMap customdata)
24032410 {
24042411 // ::Timer_OnCheckpointLoadPost <- function(player)
24052412 VScriptExecute Timer_OnCheckpointLoadPost = new VScriptExecute (HSCRIPT_RootTable .GetValue (" Timer_OnCheckpointLoadPost" ));
2406- Timer_OnCheckpointLoadPost .SetParam (1 , FIELD_HSCRIPT , VScript_EntityToHScript ( client ) );
2413+ Timer_OnCheckpointLoadPost .SetParam (1 , FIELD_HSCRIPT , gH_PlayerHSCRIPT [ client ] );
24072414 Timer_OnCheckpointLoadPost .Execute ();
24082415 delete Timer_OnCheckpointLoadPost ;
24092416 }
0 commit comments