From 52147ca75f75bbe9d36bc44699415c2b44de97b8 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Fri, 3 Jul 2015 08:57:15 -0400 Subject: [PATCH] Use datadesc instead of serverclass for m_iName lookup. m_iName is not networked on all games. --- core/HalfLife2.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index 2e0c9f8b..d4c173b7 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -1290,17 +1290,14 @@ string_t CHalfLife2::AllocPooledString(const char *pszValue) // read back the new targetname value, restore the old value, and return the new one. CBaseEntity *pEntity = ((IServerUnknown *) servertools->FirstEntity())->GetBaseEntity(); - auto *pNetworkable = ((IServerUnknown *) pEntity)->GetNetworkable(); - assert(pNetworkable); - - auto pServerClass = pNetworkable->GetServerClass(); - assert(pServerClass); + auto *pDataMap = GetDataMap(pEntity); + assert(pDataMap); static int offset = -1; if (offset == -1) { - sm_sendprop_info_t info; - bool found = UTIL_FindInSendTable(pServerClass->m_pTable, "m_iName", &info, 0); + sm_datatable_info_t info; + bool found = FindDataMapInfo(pDataMap, "m_iName", &info); assert(found); offset = info.actual_offset; }