From 975fc93e1f9a038d518db6c35418d88111fd05d6 Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Wed, 4 Jun 2014 17:36:53 -0700 Subject: [PATCH] Replace SourceHook list usages in tf with AMTL. --- extensions/tf2/RegNatives.cpp | 10 ++++------ extensions/tf2/RegNatives.h | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/extensions/tf2/RegNatives.cpp b/extensions/tf2/RegNatives.cpp index 03b1cce6..19c0aff2 100644 --- a/extensions/tf2/RegNatives.cpp +++ b/extensions/tf2/RegNatives.cpp @@ -36,17 +36,15 @@ RegNatives g_RegNatives; void RegNatives::Register(ICallWrapper *pWrapper) { - m_List.push_back(pWrapper); + m_Natives.append(pWrapper); } void RegNatives::UnregisterAll() { - SourceHook::List::iterator iter; - - for (iter=m_List.begin(); iter!=m_List.end(); iter++) + for (size_t iter = 0; iter < m_Natives.length(); ++iter) { - (*iter)->Destroy(); + m_Natives[iter]->Destroy(); } - m_List.clear(); + m_Natives.clear(); } diff --git a/extensions/tf2/RegNatives.h b/extensions/tf2/RegNatives.h index b355dbc3..2ecd3c4b 100644 --- a/extensions/tf2/RegNatives.h +++ b/extensions/tf2/RegNatives.h @@ -32,7 +32,7 @@ #ifndef _INCLUDE_TF2TOOLS_REGNATIVES_H_ #define _INCLUDE_TF2TOOLS_REGNATIVES_H_ -#include +#include class RegNatives { @@ -40,7 +40,7 @@ public: void Register(ICallWrapper *pWrapper); void UnregisterAll(); private: - SourceHook::List m_List; + ke::Vector m_Natives; }; extern RegNatives g_RegNatives;