| 490 | } |
| 491 | |
| 492 | static 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 | |
| 523 | static cell_t GetConVarDefault(IPluginContext *pContext, const cell_t *params) |
| 524 | { |
nothing calls this directly
no test coverage detected