Replace ke::Vector with std::vector.

This commit is contained in:
David Anderson
2020-05-31 11:35:51 -07:00
parent e5ddbd9886
commit 5d94f0bea8
41 changed files with 1174 additions and 1174 deletions
+10 -10
View File
@@ -59,7 +59,7 @@ void CookieManager::Unload()
}
/* Find all cookies and delete them */
for (size_t iter = 0; iter < cookieList.length(); ++iter)
for (size_t iter = 0; iter < cookieList.size(); ++iter)
delete cookieList[iter];
cookieList.clear();
@@ -95,7 +95,7 @@ Cookie *CookieManager::CreateCookie(const char *name, const char *description, C
op->m_params.cookie = pCookie;
cookieFinder.insert(name, pCookie);
cookieList.append(pCookie);
cookieList.push_back(pCookie);
g_ClientPrefs.AddQueryToQueue(op);
@@ -111,7 +111,7 @@ bool CookieManager::GetCookieValue(Cookie *pCookie, int client, char **value)
{
data = new CookieData("");
data->parent = pCookie;
clientData[client].append(data);
clientData[client].push_back(data);
pCookie->data[client] = data;
data->changed = false;
data->timestamp = 0;
@@ -130,7 +130,7 @@ bool CookieManager::SetCookieValue(Cookie *pCookie, int client, const char *valu
{
data = new CookieData(value);
data->parent = pCookie;
clientData[client].append(data);
clientData[client].push_back(data);
pCookie->data[client] = data;
}
else
@@ -185,8 +185,8 @@ void CookieManager::OnClientDisconnecting(int client)
g_ClientPrefs.ClearQueryCache(player->GetSerial());
}
ke::Vector<CookieData *> &clientvec = clientData[client];
for (size_t iter = 0; iter < clientvec.length(); ++iter)
std::vector<CookieData *> &clientvec = clientData[client];
for (size_t iter = 0; iter < clientvec.size(); ++iter)
{
current = clientvec[iter];
dbId = current->parent->dbid;
@@ -263,7 +263,7 @@ void CookieManager::ClientConnectCallback(int serial, IQuery *data)
pData->parent = parent;
parent->data[client] = pData;
clientData[client].append(pData);
clientData[client].push_back(pData);
}
statsLoaded[client] = true;
@@ -317,18 +317,18 @@ bool CookieManager::AreClientCookiesPending(int client)
void CookieManager::OnPluginDestroyed(IPlugin *plugin)
{
ke::Vector<char *> *pList;
std::vector<char *> *pList;
if (plugin->GetProperty("SettingsMenuItems", (void **)&pList, true))
{
ke::Vector<char *> &menuitems = (*pList);
std::vector<char *> &menuitems = (*pList);
char *name;
ItemDrawInfo draw;
const char *info;
AutoMenuData * data;
unsigned itemcount;
for (size_t p_iter = 0; p_iter < menuitems.length(); ++p_iter)
for (size_t p_iter = 0; p_iter < menuitems.size(); ++p_iter)
{
name = menuitems[p_iter];
itemcount = clientMenu->GetItemCount();
+2 -2
View File
@@ -132,12 +132,12 @@ public:
public:
IForward *cookieDataLoadedForward;
ke::Vector<Cookie *> cookieList;
std::vector<Cookie *> cookieList;
IBaseMenu *clientMenu;
private:
NameHashSet<Cookie *> cookieFinder;
ke::Vector<CookieData *> clientData[SM_MAXPLAYERS+1];
std::vector<CookieData *> clientData[SM_MAXPLAYERS+1];
bool connected[SM_MAXPLAYERS+1];
bool statsLoaded[SM_MAXPLAYERS+1];
+4 -4
View File
@@ -313,7 +313,7 @@ bool ClientPrefs::AddQueryToQueue(TQueryOp *query)
std::lock_guard<std::mutex> lock(queryLock);
if (!Database)
{
cachedQueries.append(query);
cachedQueries.push_back(query);
return false;
}
@@ -331,7 +331,7 @@ void ClientPrefs::ProcessQueryCache()
if (!Database)
return;
for (size_t iter = 0; iter < cachedQueries.length(); ++iter)
for (size_t iter = 0; iter < cachedQueries.size(); ++iter)
{
TQueryOp *op = cachedQueries[iter];
op->SetDatabase(Database);
@@ -373,13 +373,13 @@ void ClientPrefs::ClearQueryCache(int serial)
{
std::lock_guard<std::mutex> lock(queryLock);
for (size_t iter = 0; iter < cachedQueries.length(); ++iter)
for (size_t iter = 0; iter < cachedQueries.size(); ++iter)
{
TQueryOp *op = cachedQueries[iter];
if (op && op->PullQueryType() == Query_SelectData && op->PullQuerySerial() == serial)
{
op->Destroy();
cachedQueries.remove(iter--);
ke::RemoveAt(&cachedQueries, iter--);
}
}
}
+1 -1
View File
@@ -158,7 +158,7 @@ public:
bool databaseLoading;
private:
ke::Vector<TQueryOp *> cachedQueries;
std::vector<TQueryOp *> cachedQueries;
std::mutex queryLock;
IdentityToken_t *identity;
};
+7 -7
View File
@@ -299,7 +299,7 @@ static cell_t ReadCookieIterator(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Invalid Cookie iterator handle %x (error %d)", hndl, err);
}
if (*iter >= g_CookieManager.cookieList.length())
if (*iter >= g_CookieManager.cookieList.size())
{
return 0;
}
@@ -356,18 +356,18 @@ cell_t AddSettingsMenuItem(IPluginContext *pContext, const cell_t *params)
/* Track this in case the plugin unloads */
IPlugin *pPlugin = plsys->FindPluginByContext(pContext->GetContext());
ke::Vector<char *> *pList = NULL;
std::vector<char *> *pList = NULL;
if (!pPlugin->GetProperty("SettingsMenuItems", (void **)&pList, false) || !pList)
{
pList = new ke::Vector<char *>;
pList = new std::vector<char *>;
pPlugin->SetProperty("SettingsMenuItems", pList);
}
char *copyarray = new char[strlen(display)+1];
g_pSM->Format(copyarray, strlen(display)+1, "%s", display);
pList->append(copyarray);
pList->push_back(copyarray);
return 0;
}
@@ -426,18 +426,18 @@ cell_t AddSettingsPrefabMenuItem(IPluginContext *pContext, const cell_t *params)
/* Track this in case the plugin unloads */
IPlugin *pPlugin = plsys->FindPluginByContext(pContext->GetContext());
ke::Vector<char *> *pList = NULL;
std::vector<char *> *pList = NULL;
if (!pPlugin->GetProperty("SettingsMenuItems", (void **)&pList, false) || !pList)
{
pList = new ke::Vector<char *>;
pList = new std::vector<char *>;
pPlugin->SetProperty("SettingsMenuItems", pList);
}
char *copyarray = new char[strlen(display)+1];
g_pSM->Format(copyarray, strlen(display)+1, "%s", display);
pList->append(copyarray);
pList->push_back(copyarray);
return 0;
}
+2 -2
View File
@@ -36,12 +36,12 @@ RegNatives g_RegNatives;
void RegNatives::Register(ICallWrapper *pWrapper)
{
m_Natives.append(pWrapper);
m_Natives.push_back(pWrapper);
}
void RegNatives::UnregisterAll()
{
for (size_t iter = 0; iter < m_Natives.length(); ++iter)
for (size_t iter = 0; iter < m_Natives.size(); ++iter)
{
m_Natives[iter]->Destroy();
}
+1 -1
View File
@@ -40,7 +40,7 @@ public:
void Register(ICallWrapper *pWrapper);
void UnregisterAll();
private:
ke::Vector<ICallWrapper *> m_Natives;
std::vector<ICallWrapper *> m_Natives;
};
extern RegNatives g_RegNatives;
+87 -87
View File
@@ -101,7 +101,7 @@ SDKHooks g_Interface;
SMEXT_LINK(&g_Interface);
CGlobalVars *gpGlobals;
ke::Vector<CVTableList *> g_HookList[SDKHook_MAXHOOKS];
std::vector<CVTableList *> g_HookList[SDKHook_MAXHOOKS];
IBinTools *g_pBinTools = NULL;
ICvar *icvar = NULL;
@@ -454,17 +454,17 @@ FeatureStatus SDKHooks::GetFeatureStatus(FeatureType type, const char *name)
* Functions
*/
static void PopulateCallbackList(const ke::Vector<HookList> &source, ke::Vector<IPluginFunction *> &destination, int entity)
static void PopulateCallbackList(const std::vector<HookList> &source, std::vector<IPluginFunction *> &destination, int entity)
{
destination.ensure(8); /* Skip trivial allocations as AMTL uses length<<1. */
for (size_t iter = 0; iter < source.length(); ++iter)
destination.reserve(8);
for (size_t iter = 0; iter < source.size(); ++iter)
{
if (source[iter].entity != entity)
{
continue;
}
destination.append(source[iter].callback);
destination.push_back(source[iter].callback);
}
}
@@ -483,8 +483,8 @@ cell_t SDKHooks::Call(CBaseEntity *pEnt, SDKHookType type, CBaseEntity *pOther)
cell_t ret = Pl_Continue;
CVTableHook vhook(pEnt);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -494,9 +494,9 @@ cell_t SDKHooks::Call(CBaseEntity *pEnt, SDKHookType type, CBaseEntity *pOther)
int entity = gamehelpers->EntityToBCompatRef(pEnt);
int other = gamehelpers->EntityToBCompatRef(pOther);
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -584,8 +584,8 @@ HookReturn SDKHooks::Hook(int entity, SDKHookType type, IPluginFunction *callbac
size_t entry;
CVTableHook vhook(pEnt);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook == vtablehooklist[entry]->vtablehook)
{
@@ -593,7 +593,7 @@ HookReturn SDKHooks::Hook(int entity, SDKHookType type, IPluginFunction *callbac
}
}
if (entry == vtablehooklist.length())
if (entry == vtablehooklist.size())
{
int hookid = 0;
switch(type)
@@ -738,14 +738,14 @@ HookReturn SDKHooks::Hook(int entity, SDKHookType type, IPluginFunction *callbac
CVTableList *vtablelist = new CVTableList;
vtablelist->vtablehook = new CVTableHook(vhook);
vtablehooklist.append(vtablelist);
vtablehooklist.push_back(vtablelist);
}
// Add hook to hook list
HookList hook;
hook.entity = gamehelpers->EntityToBCompatRef(pEnt);
hook.callback = callback;
vtablehooklist[entry]->hooks.append(hook);
vtablehooklist[entry]->hooks.push_back(hook);
return HookRet_Successful;
}
@@ -760,24 +760,24 @@ void SDKHooks::Unhook(CBaseEntity *pEntity)
int entity = gamehelpers->EntityToBCompatRef(pEntity);
for (size_t type = 0; type < SDKHook_MAXHOOKS; ++type)
{
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t listentry = 0; listentry < vtablehooklist.length(); ++listentry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t listentry = 0; listentry < vtablehooklist.size(); ++listentry)
{
ke::Vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks;
for (size_t entry = 0; entry < pawnhooks.length(); ++entry)
std::vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks;
for (size_t entry = 0; entry < pawnhooks.size(); ++entry)
{
if (entity != pawnhooks[entry].entity)
{
continue;
}
pawnhooks.remove(entry--);
ke::RemoveAt(&pawnhooks, entry--);
}
if (pawnhooks.length() == 0)
if (pawnhooks.size() == 0)
{
delete vtablehooklist[listentry];
vtablehooklist.remove(listentry--);
ke::RemoveAt(&vtablehooklist, listentry--);
}
}
}
@@ -787,24 +787,24 @@ void SDKHooks::Unhook(IPluginContext *pContext)
{
for (size_t type = 0; type < SDKHook_MAXHOOKS; ++type)
{
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t listentry = 0; listentry < vtablehooklist.length(); ++listentry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t listentry = 0; listentry < vtablehooklist.size(); ++listentry)
{
ke::Vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks;
for (size_t entry = 0; entry < pawnhooks.length(); ++entry)
std::vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks;
for (size_t entry = 0; entry < pawnhooks.size(); ++entry)
{
if (pContext != NULL && pContext != pawnhooks[entry].callback->GetParentRuntime()->GetDefaultContext())
{
continue;
}
pawnhooks.remove(entry--);
ke::RemoveAt(&pawnhooks, entry--);
}
if (pawnhooks.length() == 0)
if (pawnhooks.size() == 0)
{
delete vtablehooklist[listentry];
vtablehooklist.remove(listentry--);
ke::RemoveAt(&vtablehooklist, listentry--);
}
}
}
@@ -819,8 +819,8 @@ void SDKHooks::Unhook(int entity, SDKHookType type, IPluginFunction *pCallback)
}
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t listentry = 0; listentry < vtablehooklist.length(); ++listentry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[type];
for (size_t listentry = 0; listentry < vtablehooklist.size(); ++listentry)
{
if (vhook != vtablehooklist[listentry]->vtablehook)
{
@@ -829,8 +829,8 @@ void SDKHooks::Unhook(int entity, SDKHookType type, IPluginFunction *pCallback)
entity = gamehelpers->EntityToBCompatRef(pEntity);
ke::Vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks;
for (size_t entry = 0; entry < pawnhooks.length(); ++entry)
std::vector<HookList> &pawnhooks = vtablehooklist[listentry]->hooks;
for (size_t entry = 0; entry < pawnhooks.size(); ++entry)
{
HookList &hookentry = pawnhooks[entry];
if (entity != hookentry.entity || pCallback != hookentry.callback)
@@ -838,13 +838,13 @@ void SDKHooks::Unhook(int entity, SDKHookType type, IPluginFunction *pCallback)
continue;
}
pawnhooks.remove(entry--);
ke::RemoveAt(&pawnhooks, entry--);
}
if (pawnhooks.length() == 0)
if (pawnhooks.size() == 0)
{
delete vtablehooklist[listentry];
vtablehooklist.remove(listentry);
ke::RemoveAt(&vtablehooklist, listentry);
}
break;
@@ -932,8 +932,8 @@ bool SDKHooks::Hook_CanBeAutobalanced()
CBaseEntity *pPlayer = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pPlayer);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_CanBeAutobalanced];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_CanBeAutobalanced];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -945,9 +945,9 @@ bool SDKHooks::Hook_CanBeAutobalanced()
bool origRet = SH_MCALL(pPlayer, CanBeAutobalanced)();
bool newRet = origRet;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
cell_t res = origRet;
IPluginFunction *callback = callbackList[entry];
@@ -1000,8 +1000,8 @@ void SDKHooks::Hook_FireBulletsPost(const FireBulletsInfo_t &info)
RETURN_META(MRES_IGNORED);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_FireBulletsPost];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_FireBulletsPost];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1010,9 +1010,9 @@ void SDKHooks::Hook_FireBulletsPost(const FireBulletsInfo_t &info)
const char *weapon = pInfo->GetWeaponName();
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1034,8 +1034,8 @@ int SDKHooks::Hook_GetMaxHealth()
int original_max = SH_MCALL(pEntity, GetMaxHealth)();
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_GetMaxHealth];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_GetMaxHealth];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1048,9 +1048,9 @@ int SDKHooks::Hook_GetMaxHealth()
cell_t res = Pl_Continue;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1078,8 +1078,8 @@ int SDKHooks::HandleOnTakeDamageHook(CTakeDamageInfoHack &info, SDKHookType hook
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[hookType];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[hookType];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1101,9 +1101,9 @@ int SDKHooks::HandleOnTakeDamageHook(CTakeDamageInfoHack &info, SDKHookType hook
cell_t res, ret = Pl_Continue;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1169,8 +1169,8 @@ int SDKHooks::HandleOnTakeDamageHookPost(CTakeDamageInfoHack &info, SDKHookType
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[hookType];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[hookType];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1179,9 +1179,9 @@ int SDKHooks::HandleOnTakeDamageHookPost(CTakeDamageInfoHack &info, SDKHookType
int entity = gamehelpers->EntityToBCompatRef(pEntity);
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1257,8 +1257,8 @@ bool SDKHooks::Hook_Reload()
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_Reload];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_Reload];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1268,9 +1268,9 @@ bool SDKHooks::Hook_Reload()
int entity = gamehelpers->EntityToBCompatRef(pEntity);
cell_t res = Pl_Continue;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1291,8 +1291,8 @@ bool SDKHooks::Hook_ReloadPost()
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_ReloadPost];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_ReloadPost];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1302,9 +1302,9 @@ bool SDKHooks::Hook_ReloadPost()
int entity = gamehelpers->EntityToBCompatRef(pEntity);
cell_t origreturn = META_RESULT_ORIG_RET(bool) ? 1 : 0;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1333,8 +1333,8 @@ bool SDKHooks::Hook_ShouldCollide(int collisionGroup, int contentsMask)
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_ShouldCollide];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_ShouldCollide];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1345,9 +1345,9 @@ bool SDKHooks::Hook_ShouldCollide(int collisionGroup, int contentsMask)
cell_t origRet = ((META_RESULT_STATUS >= MRES_OVERRIDE)?(META_RESULT_OVERRIDE_RET(bool)):(META_RESULT_ORIG_RET(bool))) ? 1 : 0;
cell_t res = 0;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1374,8 +1374,8 @@ void SDKHooks::Hook_Spawn()
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_Spawn];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_Spawn];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1385,9 +1385,9 @@ void SDKHooks::Hook_Spawn()
int entity = gamehelpers->EntityToBCompatRef(pEntity);
cell_t res = Pl_Continue;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1460,8 +1460,8 @@ void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir,
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_TraceAttack];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_TraceAttack];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1476,9 +1476,9 @@ void SDKHooks::Hook_TraceAttack(CTakeDamageInfoHack &info, const Vector &vecDir,
int ammotype = info.GetAmmoType();
cell_t res, ret = Pl_Continue;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1541,8 +1541,8 @@ void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vec
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_TraceAttackPost];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_TraceAttackPost];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1551,9 +1551,9 @@ void SDKHooks::Hook_TraceAttackPost(CTakeDamageInfoHack &info, const Vector &vec
int entity = gamehelpers->EntityToBCompatRef(pEntity);
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1578,8 +1578,8 @@ void SDKHooks::Hook_Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_Use];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_Use];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1591,9 +1591,9 @@ void SDKHooks::Hook_Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE
int caller = gamehelpers->EntityToBCompatRef(pCaller);
cell_t ret = Pl_Continue;
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
@@ -1618,8 +1618,8 @@ void SDKHooks::Hook_UsePost(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
CBaseEntity *pEntity = META_IFACEPTR(CBaseEntity);
CVTableHook vhook(pEntity);
ke::Vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_UsePost];
for (size_t entry = 0; entry < vtablehooklist.length(); ++entry)
std::vector<CVTableList *> &vtablehooklist = g_HookList[SDKHook_UsePost];
for (size_t entry = 0; entry < vtablehooklist.size(); ++entry)
{
if (vhook != vtablehooklist[entry]->vtablehook)
{
@@ -1630,9 +1630,9 @@ void SDKHooks::Hook_UsePost(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_T
int activator = gamehelpers->EntityToBCompatRef(pActivator);
int caller = gamehelpers->EntityToBCompatRef(pCaller);
ke::Vector<IPluginFunction *> callbackList;
std::vector<IPluginFunction *> callbackList;
PopulateCallbackList(vtablehooklist[entry]->hooks, callbackList, entity);
for (entry = 0; entry < callbackList.length(); ++entry)
for (entry = 0; entry < callbackList.size(); ++entry)
{
IPluginFunction *callback = callbackList[entry];
callback->PushCell(entity);
+2 -2
View File
@@ -127,7 +127,7 @@ public:
};
public:
CVTableHook *vtablehook;
ke::Vector<HookList> hooks;
std::vector<HookList> hooks;
};
class IEntityListener
@@ -344,7 +344,7 @@ private:
};
extern CGlobalVars *gpGlobals;
extern ke::Vector<CVTableList *> g_HookList[SDKHook_MAXHOOKS];
extern std::vector<CVTableList *> g_HookList[SDKHook_MAXHOOKS];
extern ICvar *icvar;
+13 -13
View File
@@ -169,9 +169,9 @@ void CHookManager::PlayerRunCmdHook(int client, bool post)
return;
}
ke::Vector<CVTableHook *> &runUserCmdHookVec = post ? m_runUserCmdPostHooks : m_runUserCmdHooks;
std::vector<CVTableHook *> &runUserCmdHookVec = post ? m_runUserCmdPostHooks : m_runUserCmdHooks;
CVTableHook hook(pEntity);
for (size_t i = 0; i < runUserCmdHookVec.length(); ++i)
for (size_t i = 0; i < runUserCmdHookVec.size(); ++i)
{
if (hook == runUserCmdHookVec[i])
{
@@ -186,7 +186,7 @@ void CHookManager::PlayerRunCmdHook(int client, bool post)
hookid = SH_ADD_MANUALVPHOOK(PlayerRunCmdHook, pEntity, SH_MEMBER(this, &CHookManager::PlayerRunCmd), false);
hook.SetHookID(hookid);
runUserCmdHookVec.append(new CVTableHook(hook));
runUserCmdHookVec.push_back(new CVTableHook(hook));
}
void CHookManager::PlayerRunCmd(CUserCmd *ucmd, IMoveHelper *moveHelper)
@@ -332,16 +332,16 @@ void CHookManager::NetChannelHook(int client)
}
else
#endif
if (!m_netChannelHooks.length())
if (!m_netChannelHooks.size())
{
CVTableHook filehook(basefilesystem);
int hookid = SH_ADD_VPHOOK(IBaseFileSystem, FileExists, basefilesystem, SH_MEMBER(this, &CHookManager::FileExists), false);
filehook.SetHookID(hookid);
m_netChannelHooks.append(new CVTableHook(filehook));
m_netChannelHooks.push_back(new CVTableHook(filehook));
}
for (iter = 0; iter < m_netChannelHooks.length(); ++iter)
for (iter = 0; iter < m_netChannelHooks.size(); ++iter)
{
if (nethook == m_netChannelHooks[iter])
{
@@ -349,19 +349,19 @@ void CHookManager::NetChannelHook(int client)
}
}
if (iter == m_netChannelHooks.length())
if (iter == m_netChannelHooks.size())
{
int hookid = SH_ADD_VPHOOK(INetChannel, SendFile, pNetChannel, SH_MEMBER(this, &CHookManager::SendFile), false);
nethook.SetHookID(hookid);
m_netChannelHooks.append(new CVTableHook(nethook));
m_netChannelHooks.push_back(new CVTableHook(nethook));
hookid = SH_ADD_VPHOOK(INetChannel, ProcessPacket, pNetChannel, SH_MEMBER(this, &CHookManager::ProcessPacket), false);
nethook.SetHookID(hookid);
m_netChannelHooks.append(new CVTableHook(nethook));
m_netChannelHooks.push_back(new CVTableHook(nethook));
hookid = SH_ADD_VPHOOK(INetChannel, ProcessPacket, pNetChannel, SH_MEMBER(this, &CHookManager::ProcessPacket_Post), true);
nethook.SetHookID(hookid);
m_netChannelHooks.append(new CVTableHook(nethook));
m_netChannelHooks.push_back(new CVTableHook(nethook));
}
}
}
@@ -508,7 +508,7 @@ void CHookManager::OnPluginUnloaded(IPlugin *plugin)
{
if (PRCH_used && !m_usercmdsFwd->GetFunctionCount())
{
for (size_t i = 0; i < m_runUserCmdHooks.length(); ++i)
for (size_t i = 0; i < m_runUserCmdHooks.size(); ++i)
{
delete m_runUserCmdHooks[i];
}
@@ -519,7 +519,7 @@ void CHookManager::OnPluginUnloaded(IPlugin *plugin)
if (PRCHPost_used && !m_usercmdsPostFwd->GetFunctionCount())
{
for (size_t i = 0; i < m_runUserCmdPostHooks.length(); ++i)
for (size_t i = 0; i < m_runUserCmdPostHooks.size(); ++i)
{
delete m_runUserCmdPostHooks[i];
}
@@ -530,7 +530,7 @@ void CHookManager::OnPluginUnloaded(IPlugin *plugin)
if (FILE_used && !m_netFileSendFwd->GetFunctionCount() && !m_netFileReceiveFwd->GetFunctionCount())
{
for (size_t i = 0; i < m_netChannelHooks.length(); ++i)
for (size_t i = 0; i < m_netChannelHooks.size(); ++i)
{
delete m_netChannelHooks[i];
}
+3 -3
View File
@@ -75,9 +75,9 @@ private:
IForward *m_usercmdsPostFwd;
IForward *m_netFileSendFwd;
IForward *m_netFileReceiveFwd;
ke::Vector<CVTableHook *> m_runUserCmdHooks;
ke::Vector<CVTableHook *> m_runUserCmdPostHooks;
ke::Vector<CVTableHook *> m_netChannelHooks;
std::vector<CVTableHook *> m_runUserCmdHooks;
std::vector<CVTableHook *> m_runUserCmdPostHooks;
std::vector<CVTableHook *> m_netChannelHooks;
INetChannel *m_pActiveNetChannel;
bool m_bFSTranHookWarned = false;
bool m_bReplayEnabled = false;
+2 -2
View File
@@ -36,12 +36,12 @@ RegNatives g_RegNatives;
void RegNatives::Register(ICallWrapper *pWrapper)
{
m_Natives.append(pWrapper);
m_Natives.push_back(pWrapper);
}
void RegNatives::UnregisterAll()
{
for (size_t iter = 0; iter < m_Natives.length(); ++iter)
for (size_t iter = 0; iter < m_Natives.size(); ++iter)
{
m_Natives[iter]->Destroy();
}
+1 -1
View File
@@ -40,7 +40,7 @@ public:
void Register(ICallWrapper *pWrapper);
void UnregisterAll();
private:
ke::Vector<ICallWrapper *> m_Natives;
std::vector<ICallWrapper *> m_Natives;
};
extern RegNatives g_RegNatives;