Merge pull request #176 from Arkshine/fix/keep-geop_country-bcompat

Keep geoip_country backward compatible after #99
This commit is contained in:
Vincent Herbet 2015-01-10 14:55:49 +01:00
commit dfbc74dc5f

View File

@ -106,7 +106,13 @@ static cell AMX_NATIVE_CALL amx_geoip_country(AMX *amx, cell *params)
int length; int length;
char *ip = stripPort(MF_GetAmxString(amx, params[1], 0, &length)); char *ip = stripPort(MF_GetAmxString(amx, params[1], 0, &length));
const char *path[] = { "country", "names", getLang(params[4]), NULL }; int id = -1;
if (*params / sizeof(cell) >= 4)
{
id = params[4];
}
const char *path[] = { "country", "names", getLang(id), NULL };
const char *country = lookupString(ip, path, &length); const char *country = lookupString(ip, path, &length);
if (!country) if (!country)