diff --git a/AMBuildScript b/AMBuildScript index 87b8911f..3a1819eb 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -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']: diff --git a/core/HalfLife2.cpp b/core/HalfLife2.cpp index 91a1e0ae..833ba48f 100644 --- a/core/HalfLife2.cpp +++ b/core/HalfLife2.cpp @@ -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) { diff --git a/hl2sdk-manifests b/hl2sdk-manifests index c018a994..0019b272 160000 --- a/hl2sdk-manifests +++ b/hl2sdk-manifests @@ -1 +1 @@ -Subproject commit c018a994478d6c31f70ded7adec7aa9e2c40bb1a +Subproject commit 0019b272444b2753bbc6e27fcafddf0ea193b878