Fix usage of CBaseHandle for tf2 + Update compilation flags for clang (#2466)
This commit is contained in:
@@ -246,6 +246,7 @@ class SMConfig(object):
|
||||
'-Wno-array-bounds',
|
||||
'-Wno-unknown-pragmas',
|
||||
'-Wno-dangling-else',
|
||||
'-Wno-uninitialized-const-pointer',
|
||||
'-fvisibility=hidden',
|
||||
]
|
||||
if cxx.target.arch in ['x86', 'x86_64']:
|
||||
|
||||
+13
-1
@@ -994,7 +994,11 @@ CBaseEntity *CHalfLife2::ReferenceToEntity(cell_t entRef)
|
||||
{
|
||||
/* Proper ent reference */
|
||||
int hndlValue = entRef & ~ENTREF_MASK;
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
auto hndl = CBaseHandle::UnsafeFromIndex(hndlValue);
|
||||
#else
|
||||
CBaseHandle hndl(hndlValue);
|
||||
#endif
|
||||
|
||||
pInfo = LookupEntity(hndl.GetEntryIndex());
|
||||
if (!pInfo || pInfo->m_SerialNumber != hndl.GetSerialNumber())
|
||||
@@ -1098,7 +1102,11 @@ int CHalfLife2::ReferenceToIndex(cell_t entRef)
|
||||
{
|
||||
/* Proper ent reference */
|
||||
int hndlValue = entRef & ~ENTREF_MASK;
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
auto hndl = CBaseHandle::UnsafeFromIndex(hndlValue);
|
||||
#else
|
||||
CBaseHandle hndl(hndlValue);
|
||||
#endif
|
||||
|
||||
CEntInfo *pInfo = LookupEntity(hndl.GetEntryIndex());
|
||||
|
||||
@@ -1141,7 +1149,7 @@ cell_t CHalfLife2::EntityToBCompatRef(CBaseEntity *pEntity)
|
||||
IServerUnknown *pUnknown = (IServerUnknown *)pEntity;
|
||||
CBaseHandle hndl = pUnknown->GetRefEHandle();
|
||||
|
||||
if (hndl == INVALID_EHANDLE_INDEX)
|
||||
if (!hndl.IsValid())
|
||||
{
|
||||
return INVALID_EHANDLE_INDEX;
|
||||
}
|
||||
@@ -1164,7 +1172,11 @@ cell_t CHalfLife2::ReferenceToBCompatRef(cell_t entRef)
|
||||
}
|
||||
|
||||
int hndlValue = entRef & ~ENTREF_MASK;
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
auto hndl = CBaseHandle::UnsafeFromIndex(hndlValue);
|
||||
#else
|
||||
CBaseHandle hndl(hndlValue);
|
||||
#endif
|
||||
|
||||
if (hndl.GetEntryIndex() < MAX_EDICTS)
|
||||
{
|
||||
|
||||
+1
-1
Submodule hl2sdk-manifests updated: c018a99447...0019b27244
Reference in New Issue
Block a user