Use datadesc instead of serverclass for m_iName lookup.
m_iName is not networked on all games.
This commit is contained in:
parent
1a5714c3ca
commit
52147ca75f
@ -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.
|
// read back the new targetname value, restore the old value, and return the new one.
|
||||||
|
|
||||||
CBaseEntity *pEntity = ((IServerUnknown *) servertools->FirstEntity())->GetBaseEntity();
|
CBaseEntity *pEntity = ((IServerUnknown *) servertools->FirstEntity())->GetBaseEntity();
|
||||||
auto *pNetworkable = ((IServerUnknown *) pEntity)->GetNetworkable();
|
auto *pDataMap = GetDataMap(pEntity);
|
||||||
assert(pNetworkable);
|
assert(pDataMap);
|
||||||
|
|
||||||
auto pServerClass = pNetworkable->GetServerClass();
|
|
||||||
assert(pServerClass);
|
|
||||||
|
|
||||||
static int offset = -1;
|
static int offset = -1;
|
||||||
if (offset == -1)
|
if (offset == -1)
|
||||||
{
|
{
|
||||||
sm_sendprop_info_t info;
|
sm_datatable_info_t info;
|
||||||
bool found = UTIL_FindInSendTable(pServerClass->m_pTable, "m_iName", &info, 0);
|
bool found = FindDataMapInfo(pDataMap, "m_iName", &info);
|
||||||
assert(found);
|
assert(found);
|
||||||
offset = info.actual_offset;
|
offset = info.actual_offset;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user