MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / sm_ResetConVar

Function sm_ResetConVar

core/smn_console.cpp:492–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492static cell_t sm_ResetConVar(IPluginContext *pContext, const cell_t *params)
493{
494 Handle_t hndl = static_cast<Handle_t>(params[1]);
495 HandleError err;
496 ConVar *pConVar;
497
498 if ((err=g_ConVarManager.ReadConVarHandle(hndl, &pConVar))
499 != HandleError_None)
500 {
501 return pContext->ThrowNativeError("Invalid convar handle %x (error %d)", hndl, err);
502 }
503
504 pConVar->Revert();
505
506#if SOURCE_ENGINE < SE_ORANGEBOX
507 /* Should we replicate it? */
508 if (params[3] && IsFlagSet(pConVar, FCVAR_REPLICATED))
509 {
510 ReplicateConVar(pConVar);
511 }
512
513 /* Should we notify clients? */
514 if (params[4] && IsFlagSet(pConVar, FCVAR_NOTIFY))
515 {
516 NotifyConVar(pConVar);
517 }
518#endif
519
520 return 1;
521}
522
523static cell_t GetConVarDefault(IPluginContext *pContext, const cell_t *params)
524{

Callers

nothing calls this directly

Calls 4

IsFlagSetFunction · 0.85
ReplicateConVarFunction · 0.85
NotifyConVarFunction · 0.85
ReadConVarHandleMethod · 0.80

Tested by

no test coverage detected