Fixed get_module (which would crash on modules with new interface)

This commit is contained in:
Pavol Marko 2004-05-28 11:22:56 +00:00
parent a6af81e359
commit 3d3775ec00

View File

@ -2181,10 +2181,20 @@ static cell AMX_NATIVE_CALL get_module(AMX *amx, cell *params)
return -1; // not found return -1; // not found
// set name, author, version // set name, author, version
module_info_s *info = (*moduleIter).getInfo(); if ((*moduleIter).isAmxx())
set_amxstring(amx, params[2], info->name, params[3]); {
set_amxstring(amx, params[4], info->author, params[5]); const amxx_module_info_s *info = (*moduleIter).getInfoNew();
set_amxstring(amx, params[6], info->version, params[7]); set_amxstring(amx, params[2], info->name, params[3]);
set_amxstring(amx, params[4], info->author, params[5]);
set_amxstring(amx, params[6], info->version, params[7]);
}
else
{
module_info_s *info = (*moduleIter).getInfo();
set_amxstring(amx, params[2], info->name, params[3]);
set_amxstring(amx, params[4], info->author, params[5]);
set_amxstring(amx, params[6], info->version, params[7]);
}
// compatibility problem possible // compatibility problem possible
int numParams = params[0] / sizeof(cell); int numParams = params[0] / sizeof(cell);