From ab2794d4bd4b65b7be6420d2d3e8a89509b1d6c0 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 17 Sep 2004 01:19:03 +0000 Subject: [PATCH] Fixed files not fclose()ing Module no longer reloads on mapchange --- dlls/geoip/geoip_amxx.cpp | 8 +++++++- dlls/geoip/moduleconfig.h | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/geoip/geoip_amxx.cpp b/dlls/geoip/geoip_amxx.cpp index 9674d625..99534cf5 100755 --- a/dlls/geoip/geoip_amxx.cpp +++ b/dlls/geoip/geoip_amxx.cpp @@ -39,9 +39,15 @@ void OnAmxxAttach() MF_AddNatives(geoip_natives); } +void OnAmxxDetach() +{ + GeoIP_delete(gi); + gi = NULL; +} + AMX_NATIVE_INFO geoip_natives[] = { {"geoip_code2", amx_geoip_code2}, {"geoip_code3", amx_geoip_code3}, {"geoip_country", amx_geoip_country}, {NULL, NULL}, -}; \ No newline at end of file +}; diff --git a/dlls/geoip/moduleconfig.h b/dlls/geoip/moduleconfig.h index db0b998f..8427b667 100755 --- a/dlls/geoip/moduleconfig.h +++ b/dlls/geoip/moduleconfig.h @@ -10,7 +10,7 @@ #define MODULE_URL "http://www.bailopan.com/" #define MODULE_LOGTAG "GEOIP" // If you want the module not to be reloaded on mapchange, remove / comment out the next line -#define MODULE_RELOAD_ON_MAPCHANGE +//#define MODULE_RELOAD_ON_MAPCHANGE #ifdef __DATE__ #define MODULE_DATE __DATE__ @@ -29,7 +29,7 @@ // Do native functions init here (MF_AddNatives) #define FN_AMXX_ATTACH OnAmxxAttach // AMXX dettach -//#define FN_AMXX_DETTACH OnAmxxDettach +#define FN_AMXX_DETTACH OnAmxxDettach // All plugins loaded // Do forward functions init here (MF_RegisterForward) // #define FN_AMXX_PLUGINSLOADED OnPluginsLoaded