Implement set current checkpoint

This commit is contained in:
KiD Fearless 2020-04-03 15:07:08 -06:00
parent 1387b5451a
commit 88ca8c8159
2 changed files with 14 additions and 2 deletions

View File

@ -1704,9 +1704,19 @@ native int Shavit_SaveCheckpoint(int client);
*
* @param client Client index
*
* @return The new current checkpoint
* @return The current checkpoint
*/
native int GetCurrentCheckpoint(int client);
native int Shavit_GetCurrentCheckpoint(int client);
/**
* Sets the current checkpoint index.
*
* @param client Client index
* @param index New index to use
*
* @noreturn
*/
native void Shavit_SetCurrentCheckpoint(int client, int index);
// same as Shavit_PrintToChat() but loops through the whole server
// code stolen from the base halflife.inc file
@ -1834,5 +1844,6 @@ public void __pl_shavit_SetNTVOptional()
MarkNativeAsOptional("Shavit_SetClientTimescale");
MarkNativeAsOptional("Shavit_SaveCheckpoint");
MarkNativeAsOptional("Shavit_GetCurrentCheckpoint");
MarkNativeAsOptional("Shavit_SetCurrentCheckpoint");
}
#endif

View File

@ -192,6 +192,7 @@ public APLRes AskPluginLoad2(Handle myself, bool late, char[] error, int err_max
CreateNative("Shavit_OpenCheckpointMenu", Native_OpenCheckpointMenu);
CreateNative("Shavit_SaveCheckpoint", Native_SaveCheckpoint);
CreateNative("Shavit_GetCurrentCheckpoint", Native_GetCurrentCheckpoint);
CreateNative("Shavit_SetCurrentCheckpoint", Native_SetCurrentCheckpoint);
gB_Late = late;