Added unhooking of virtual tables at map change.
Removed some more debugging output.
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
#include <extdll.h>
|
||||
#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<Hook*> 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 <Hook *>::iterator end;
|
||||
for (int i = 0; i < HAM_LAST_ENTRY_DONT_USE_ME_LOL; i++)
|
||||
{
|
||||
end=hooks[i].end();
|
||||
|
||||
for (CVector<Hook*>::iterator j=hooks[i].begin();
|
||||
j!=end;
|
||||
++j)
|
||||
{
|
||||
delete (*j);
|
||||
}
|
||||
hooks[i].clear();
|
||||
}
|
||||
}
|
||||
|
||||
void OnPluginsLoaded(void)
|
||||
{
|
||||
NEW_Initialize(INDEXENT(0));
|
||||
|
||||
Reference in New Issue
Block a user