Work around for amb228 - amxmod_compat caused set_user_hitzones to stop functioning.

Any plugins being emulated by amxmod_compat that still use the traceline forward will still cause the issue, but if no plugins use that forward it won't interfere.

(also, plugin_flags() can now specify a plid)
This commit is contained in:
Steve Dudenhoeffer
2007-08-03 06:48:08 +00:00
parent e045e2fdb6
commit b09bf4c532
4 changed files with 50 additions and 13 deletions

View File

@ -3793,14 +3793,35 @@ static cell AMX_NATIVE_CALL register_dictionary(AMX *amx, cell *params)
static cell AMX_NATIVE_CALL plugin_flags(AMX *amx, cell *params)
{
if (params[1])
if ((params[0] / sizeof(cell)) == 1 || // compiled with old include file
params[2] < 0) // specifically want calling plugin's flags
{
AMX_HEADER *hdr;
hdr = (AMX_HEADER *)amx->base;
return hdr->flags;
}
if (params[1])
{
AMX_HEADER *hdr;
hdr = (AMX_HEADER *)amx->base;
return hdr->flags;
}
return amx->flags;
return amx->flags;
}
else
{
CPluginMngr::CPlugin* a = g_plugins.findPlugin((int)params[2]);
if (a == NULL)
{
return 0;
}
if (params[1])
{
AMX_HEADER *hdr;
hdr = (AMX_HEADER *)a->getAMX()->base;
return hdr->flags;
}
return a->getAMX()->flags;
}
}
// lang_exists(const name[]);