diff --git a/dlls/hamsandwich/amxx_api.cpp b/dlls/hamsandwich/amxx_api.cpp index 84e78b4a..c557d9d2 100644 --- a/dlls/hamsandwich/amxx_api.cpp +++ b/dlls/hamsandwich/amxx_api.cpp @@ -1,10 +1,16 @@ #include #include "sdk/amxxmodule.h" + #include "NEW_Util.h" +#include "CVector.h" +#include "forward.h" +#include "hook.h" +#include "ham_const.h" edict_t *NEW_FirstEdict; bool NEW_Initialized; +extern CVector hooks[HAM_LAST_ENTRY_DONT_USE_ME_LOL]; extern AMX_NATIVE_INFO RegisterNatives[]; @@ -12,7 +18,6 @@ int ReadConfig(void); void OnAmxxAttach(void) { - printf("LOLOL"); if (ReadConfig() > 0) { MF_AddNatives(RegisterNatives); @@ -21,6 +26,24 @@ void OnAmxxAttach(void) void HamCommand(void); +void OnPluginsUnloaded(void) +{ + + CVector ::iterator end; + for (int i = 0; i < HAM_LAST_ENTRY_DONT_USE_ME_LOL; i++) + { + end=hooks[i].end(); + + for (CVector::iterator j=hooks[i].begin(); + j!=end; + ++j) + { + delete (*j); + } + hooks[i].clear(); + } +} + void OnPluginsLoaded(void) { NEW_Initialize(INDEXENT(0)); diff --git a/dlls/hamsandwich/config_parser.cpp b/dlls/hamsandwich/config_parser.cpp index 547dedc4..702e7da4 100644 --- a/dlls/hamsandwich/config_parser.cpp +++ b/dlls/hamsandwich/config_parser.cpp @@ -203,7 +203,6 @@ static const char* get_localinfo( const char* name , const char* def = 0 ) } int read_start_section(char *data) { - printf("Section: %s\n", data); if (strncmp(data, CurrentModName, strlen(CurrentModName))==0) { data+=strlen(CurrentModName)+1; @@ -269,7 +268,6 @@ void process_key(char *data) hooklist[i].isset=1; hooklist[i].vtid=value; - printf("setting \"%s\" to %d", hooklist[i].name, hooklist[i].vtid); set=1; break; @@ -279,7 +277,7 @@ void process_key(char *data) if (set==0) { - printf("stray key in process_key: %s", data); + printf("stray key in process_key: %s\n", data); } } diff --git a/dlls/hamsandwich/hook_callbacks.cpp b/dlls/hamsandwich/hook_callbacks.cpp index 24a960c5..4ecd6908 100644 --- a/dlls/hamsandwich/hook_callbacks.cpp +++ b/dlls/hamsandwich/hook_callbacks.cpp @@ -26,7 +26,6 @@ { \ if ((*i)->state == FSTATE_OK) \ { \ - printf("id=%d\n",(*i)->id); \ thisresult=MF_ExecuteForward((*i)->id,iThis #define PRE_END() \ diff --git a/dlls/hamsandwich/hook_native.cpp b/dlls/hamsandwich/hook_native.cpp index d38c8b82..4d0846b1 100644 --- a/dlls/hamsandwich/hook_native.cpp +++ b/dlls/hamsandwich/hook_native.cpp @@ -174,7 +174,6 @@ static cell AMX_NATIVE_CALL RegisterHam(AMX *amx, cell *params) // Don't fail the plugin if this fails, just emit a normal error int fwd=hooklist[func].makefunc(amx, function); - printf("\n\n----> FORWARD = %d\n\n\n",fwd); if (fwd == -1) { MF_LogError(amx, AMX_ERR_NATIVE, "Function %s not found.", function); diff --git a/dlls/hamsandwich/sdk/moduleconfig.h b/dlls/hamsandwich/sdk/moduleconfig.h index b5b044d9..acd4d821 100644 --- a/dlls/hamsandwich/sdk/moduleconfig.h +++ b/dlls/hamsandwich/sdk/moduleconfig.h @@ -63,7 +63,7 @@ //#define FN_AMXX_PLUGINSUNLOADING OnPluginsUnloading /** All plugins are now unloaded */ -//#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded +#define FN_AMXX_PLUGINSUNLOADED OnPluginsUnloaded /**** METAMOD ****/ diff --git a/dlls/hamsandwich/srvcmd.cpp b/dlls/hamsandwich/srvcmd.cpp index bd75d7c6..ba4a21d5 100644 --- a/dlls/hamsandwich/srvcmd.cpp +++ b/dlls/hamsandwich/srvcmd.cpp @@ -39,7 +39,17 @@ void HamCommand(void) print_srvconsole("-------------------------------------------\n"); print_srvconsole("%-24s | %s | %10d\n", "pev", Offsets.IsPevSet() == 0 ? "n" : "y", Offsets.GetPev()); print_srvconsole("%-24s | %s | %10d\n", "base", Offsets.IsBaseSet() == 0 ? "n" : "y", Offsets.GetBase()); - int count=0; + + if (Offsets.IsPevSet()) + { + Total++; + } + if (Offsets.IsBaseSet()) + { + Total++; + } + + int count=2; for (int i=0; i