fixed a serious potential bug with swapping plugins to debug mode, leaving stale function pointers without plugin removal
2 * ===============================================================
3 * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
4 * ===============================================================
6 * This file is not open source and may not be copied without explicit
7 * written permission of AlliedModders LLC. This file may not be redistributed
8 * in whole or significant part.
9 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
14 #include "PluginSys.h"
15 #include "CTranslator.h"
17 static cell_t sm_LoadTranslations(IPluginContext *pCtx, const cell_t *params)
21 CPlugin *pl = (CPlugin *)g_PluginSys.FindPluginByContext(pCtx->GetContext());
23 pCtx->LocalToString(params[1], &filename);
25 index = g_Translator.FindOrAddPhraseFile(filename);
26 pl->AddLangFile(index);
31 REGISTER_NATIVES(langNativeS)
33 {"LoadTranslations", sm_LoadTranslations},