diff -r 022428df37c9 -r 7d93aa4d2bf3 sourcehook/sourcehook.h --- a/sourcehook/sourcehook.h Tue Sep 13 16:47:42 2005 +0000 +++ b/sourcehook/sourcehook.h Tue Sep 13 16:47:42 2005 +0000 @@ -70,7 +70,7 @@ #include "sh_memory.h" #include "sh_list.h" #include "sh_vector.h" -#include +#include "sh_tinyhash.h" // Good old metamod! @@ -219,7 +219,7 @@ }; typedef SourceHook::CVector OrigFuncs; - typedef std::map OrigVTables; + typedef SourceHook::THash OrigVTables; template struct CallClass { @@ -1497,8 +1497,8 @@ using namespace ::SourceHook; \ MemFuncInfo mfi; \ GetFuncInfo(m_CC->ptr, m_MFP, mfi); \ - OrigVTables::const_iterator iter = m_CC->vt.find(mfi.thisptroffs + mfi.vtbloffs); \ - if (iter == m_CC->vt.end() || mfi.vtblindex >= (int)iter->second.size() || iter->second[mfi.vtblindex] == NULL) \ + OrigVTables::iterator iter = m_CC->vt.find(mfi.thisptroffs + mfi.vtbloffs); \ + if (iter == m_CC->vt.end() || mfi.vtblindex >= (int)iter->val.size() || iter->val[mfi.vtblindex] == NULL) \ return (m_CC->ptr->*m_MFP)call; \ \ /* It's hooked. Call the original function. */ \ @@ -1507,7 +1507,7 @@ RetType(EmptyClass::*mfpnew)prms; \ void *addr; \ } u; \ - u.addr = iter->second[mfi.vtblindex]; \ + u.addr = iter->val[mfi.vtblindex]; \ \ void *adjustedthisptr = reinterpret_cast(reinterpret_cast(m_CC->ptr) + mfi.thisptroffs); \ return (reinterpret_cast(adjustedthisptr)->*u.mfpnew)call; \ @@ -1520,8 +1520,8 @@ using namespace ::SourceHook; \ MemFuncInfo mfi; \ GetFuncInfo(m_CC->ptr, m_MFP, mfi); \ - OrigVTables::const_iterator iter = m_CC->vt.find(mfi.thisptroffs + mfi.vtbloffs); \ - if (iter == m_CC->vt.end() || mfi.vtblindex >= (int)iter->second.size() || iter->second[mfi.vtblindex] == NULL) \ + OrigVTables::iterator iter = m_CC->vt.find(mfi.thisptroffs + mfi.vtbloffs); \ + if (iter == m_CC->vt.end() || mfi.vtblindex >= (int)iter->val.size() || iter->val[mfi.vtblindex] == NULL) \ return (m_CC->ptr->*m_MFP)call; \ \ /* It's hooked. Call the original function. */ \ @@ -1534,7 +1534,7 @@ intptr_t adjustor; \ } s; \ } u; \ - u.s.addr = iter->second[mfi.vtblindex]; \ + u.s.addr = iter->val[mfi.vtblindex]; \ u.s.adjustor = mfi.thisptroffs; \ \ return (reinterpret_cast(m_CC->ptr)->*u.mfpnew)call; \