Strip sourcehook containers (#2578)
This commit is contained in:
+14
-14
@@ -537,7 +537,7 @@ static cell_t smn_CreateKeyValues(IPluginContext *pCtx, const cell_t *params)
|
||||
is_empty = (firstkey[0] == '\0');
|
||||
pStk = new KeyValueStack;
|
||||
pStk->pBase = new KeyValues(name, is_empty ? NULL : firstkey, (is_empty||(firstvalue[0]=='\0')) ? NULL : firstvalue);
|
||||
pStk->pCurRoot.push(pStk->pBase);
|
||||
pStk->pCurRoot.push_front(pStk->pBase);
|
||||
|
||||
return handlesys->CreateHandle(g_KeyValueType, pStk, pCtx->GetIdentity(), g_pCoreIdent, NULL);
|
||||
}
|
||||
@@ -566,7 +566,7 @@ static cell_t smn_KeyValuesFromAddress(IPluginContext *pCtx, const cell_t *param
|
||||
*/
|
||||
KeyValueStack *pStk = new KeyValueStack;
|
||||
pStk->pBase = reinterpret_cast<KeyValues *>(addr);
|
||||
pStk->pCurRoot.push(pStk->pBase);
|
||||
pStk->pCurRoot.push_front(pStk->pBase);
|
||||
pStk->m_bDeleteOnDestroy = false;
|
||||
|
||||
return handlesys->CreateHandle(g_KeyValueType, pStk, pCtx->GetIdentity(), g_pCoreIdent, NULL);
|
||||
@@ -597,7 +597,7 @@ static cell_t smn_KvJumpToKey(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pStk->pCurRoot.push(pSubKey);
|
||||
pStk->pCurRoot.push_front(pSubKey);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -624,7 +624,7 @@ static cell_t smn_KvJumpToKeySymbol(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pStk->pCurRoot.push(pSubKey);
|
||||
pStk->pCurRoot.push_front(pSubKey);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -658,7 +658,7 @@ static cell_t smn_KvGotoFirstSubKey(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pStk->pCurRoot.push(pFirstSubKey);
|
||||
pStk->pCurRoot.push_front(pFirstSubKey);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -690,8 +690,8 @@ static cell_t smn_KvGotoNextKey(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pStk->pCurRoot.pop();
|
||||
pStk->pCurRoot.push(pSubKey);
|
||||
pStk->pCurRoot.pop_front();
|
||||
pStk->pCurRoot.push_front(pSubKey);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -716,7 +716,7 @@ static cell_t smn_KvGoBack(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
pStk->pCurRoot.pop();
|
||||
pStk->pCurRoot.pop_front();
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -742,7 +742,7 @@ static cell_t smn_KvRewind(IPluginContext *pCtx, const cell_t *params)
|
||||
{
|
||||
while (pStk->pCurRoot.size() > 1)
|
||||
{
|
||||
pStk->pCurRoot.pop();
|
||||
pStk->pCurRoot.pop_front();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -750,7 +750,7 @@ static cell_t smn_KvRewind(IPluginContext *pCtx, const cell_t *params)
|
||||
auto root = pStk->pCurRoot.begin();
|
||||
if (root != pStk->pCurRoot.end())
|
||||
{
|
||||
pStk->pCurRoot.push(*root);
|
||||
pStk->pCurRoot.push_front(*root);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -965,7 +965,7 @@ static cell_t smn_KvDeleteThis(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
KeyValues *pValues = pStk->pCurRoot.front();
|
||||
pStk->pCurRoot.pop();
|
||||
pStk->pCurRoot.pop_front();
|
||||
KeyValues *pRoot = pStk->pCurRoot.front();
|
||||
|
||||
/* We have to manually verify this since Valve sucks
|
||||
@@ -982,7 +982,7 @@ static cell_t smn_KvDeleteThis(IPluginContext *pContext, const cell_t *params)
|
||||
pValues->deleteThis();
|
||||
if (pNext)
|
||||
{
|
||||
pStk->pCurRoot.push(pNext);
|
||||
pStk->pCurRoot.push_front(pNext);
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
@@ -992,7 +992,7 @@ static cell_t smn_KvDeleteThis(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
/* Push this back on :( */
|
||||
pStk->pCurRoot.push(pValues);
|
||||
pStk->pCurRoot.push_front(pValues);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1056,7 +1056,7 @@ static cell_t smn_KvSavePosition(IPluginContext *pContext, const cell_t *params)
|
||||
}
|
||||
|
||||
KeyValues *pValues = pStk->pCurRoot.front();
|
||||
pStk->pCurRoot.push(pValues);
|
||||
pStk->pCurRoot.push_front(pValues);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user