minor changes
This commit is contained in:
parent
de30d647d4
commit
8df987cf95
|
@ -522,19 +522,11 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||
char *outptr = outbuf;
|
||||
cell *src = get_amxaddr(amx, params[parm++]);
|
||||
|
||||
enum State
|
||||
{
|
||||
S_Normal,
|
||||
S_PercentSign,
|
||||
};
|
||||
|
||||
State curState = S_Normal;
|
||||
while (*src)
|
||||
{
|
||||
if (*src == '%' && curState == S_Normal)
|
||||
curState = S_PercentSign;
|
||||
else if (curState == S_PercentSign)
|
||||
if (*src == '%')
|
||||
{
|
||||
++src;
|
||||
if (*src=='L')
|
||||
{
|
||||
cell langName = params[parm]; // "en" case (langName contains the address to the string)
|
||||
|
@ -592,7 +584,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||
if (*def == '%')
|
||||
{
|
||||
++def;
|
||||
char format[32];
|
||||
static char format[32];
|
||||
format[0] = '%';
|
||||
char *ptr = format+1;
|
||||
while (ptr-format<sizeof(format) && !isalpha(*ptr++ = *def++))
|
||||
|
@ -604,7 +596,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||
{
|
||||
case 's':
|
||||
{
|
||||
char tmpString[4096];
|
||||
static char tmpString[4096];
|
||||
char *tmpPtr = tmpString;
|
||||
NEXT_PARAM();
|
||||
cell *tmpCell = get_amxaddr(amx, params[parm++]);
|
||||
|
@ -676,7 +668,7 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||
}
|
||||
else
|
||||
{
|
||||
char tmpString[4096];
|
||||
static char tmpString[4096];
|
||||
char *tmpPtr = tmpString;
|
||||
int tmpLen = 0;
|
||||
char format[32];
|
||||
|
@ -730,7 +722,6 @@ char * CLangMngr::FormatAmxString(AMX *amx, cell *params, int parm, int &len)
|
|||
*outptr++ = '%';
|
||||
}
|
||||
}
|
||||
curState = S_Normal;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -157,7 +157,6 @@ extern XVars g_xvars;
|
|||
extern bool g_bmod_cstrike;
|
||||
extern bool g_bmod_dod;
|
||||
extern bool g_dontprecache;
|
||||
extern bool g_initialized;
|
||||
extern int g_srvindex;
|
||||
extern cvar_t* amxmodx_version;
|
||||
extern cvar_t* hostname;
|
||||
|
|
|
@ -81,7 +81,6 @@ bool g_bmod_dod;
|
|||
bool g_dontprecache;
|
||||
bool g_forcedmodules;
|
||||
bool g_forcedsounds;
|
||||
bool g_initialized;
|
||||
fakecmd_t g_fakecmd;
|
||||
float g_game_restarting;
|
||||
float g_game_timeleft;
|
||||
|
@ -200,9 +199,6 @@ const char* get_localinfo( const char* name , const char* def )
|
|||
// Call precache forward function from plugins
|
||||
int C_Spawn( edict_t *pent ) {
|
||||
|
||||
if ( g_initialized ) RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
|
||||
g_initialized = true;
|
||||
g_forcedmodules = false;
|
||||
g_forcedsounds = false;
|
||||
|
||||
|
@ -299,6 +295,9 @@ int C_Spawn( edict_t *pent ) {
|
|||
}
|
||||
|
||||
|
||||
// HACKHACK:
|
||||
// Make sure this function wont be called anymore
|
||||
g_FakeMeta.m_Plugins.begin()->GetDllFuncTable().pfnSpawn = NULL;
|
||||
RETURN_META_VALUE(MRES_IGNORED, 0);
|
||||
}
|
||||
|
||||
|
@ -440,7 +439,9 @@ void C_ServerDeactivate() {
|
|||
// However leave AMX modules which are loaded only once
|
||||
void C_ServerDeactivate_Post() {
|
||||
|
||||
g_initialized = false;
|
||||
// HACKHACK:
|
||||
// Make sure the spawn function will be called again
|
||||
g_FakeMeta.m_Plugins.begin()->GetDllFuncTable().pfnSpawn = C_Spawn;
|
||||
|
||||
detachReloadModules();
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user