mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-24 13:55:36 +03:00
Cleanup some code from previous commits
This commit is contained in:
parent
553663c952
commit
e95d5ed43c
@ -124,13 +124,7 @@ static cell AMX_NATIVE_CALL amx_geoip_country_ex(AMX *amx, cell *params)
|
||||
int length;
|
||||
char *ip = stripPort(MF_GetAmxString(amx, params[1], 0, &length));
|
||||
|
||||
int id = -1;
|
||||
if (*params / sizeof(cell) >= 4)
|
||||
{
|
||||
id = params[4];
|
||||
}
|
||||
|
||||
const char *path[] = { "country", "names", getLang(id), NULL };
|
||||
const char *path[] = { "country", "names", getLang(params[4]), NULL };
|
||||
const char *country = lookupString(ip, path, &length);
|
||||
|
||||
return MF_SetAmxStringUTF8Char(amx, params[2], country ? country : "", length, params[3] + 1);
|
||||
|
@ -167,7 +167,9 @@ const char *lookupString(const char *ip, const char **path, int *length)
|
||||
if (!lookupByIp(ip, path, &result))
|
||||
{
|
||||
if (length)
|
||||
{
|
||||
*length = 0;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user