From e95d5ed43caa9e730f10f1dff41231e8b18bf0ac Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sun, 8 Feb 2015 11:23:54 +0100 Subject: [PATCH] Cleanup some code from previous commits --- dlls/geoip/geoip_natives.cpp | 8 +------- dlls/geoip/geoip_util.cpp | 2 ++ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/dlls/geoip/geoip_natives.cpp b/dlls/geoip/geoip_natives.cpp index 14cd97d4..993fede0 100755 --- a/dlls/geoip/geoip_natives.cpp +++ b/dlls/geoip/geoip_natives.cpp @@ -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); diff --git a/dlls/geoip/geoip_util.cpp b/dlls/geoip/geoip_util.cpp index a805ae62..b322d775 100644 --- a/dlls/geoip/geoip_util.cpp +++ b/dlls/geoip/geoip_util.cpp @@ -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; }