Add extension methods for clearing netprop & datamaps cache (#1943)

This commit is contained in:
Corey D
2025-04-07 15:26:09 +02:00
committed by GitHub
parent 30da01763d
commit a35e22c76e
3 changed files with 41 additions and 1 deletions
+23
View File
@@ -1600,3 +1600,26 @@ uint64_t CHalfLife2::GetServerSteamId64() const
return 1ULL;
}
void CHalfLife2::RemoveDataTableCache(datamap_t *pMap)
{
if (pMap == nullptr)
{
m_Maps.clear();
return;
}
m_Maps.removeIfExists(pMap);
}
bool CHalfLife2::RemoveSendPropCache(const char *classname)
{
if (classname == nullptr)
{
m_Classes.clear();
return true;
}
return m_Classes.remove(classname);
}