Fix crash related to KeyValues for sdk2013/2025 games (#2588)
This commit is contained in:
+7
-3
@@ -51,6 +51,10 @@
|
||||
#include <vietnam_usermessages.pb.h>
|
||||
#endif
|
||||
|
||||
#if SOURCE_ENGINE == SE_TF2 || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_CSS
|
||||
#define SE_SDK2013_2025
|
||||
#endif
|
||||
|
||||
typedef ICommandLine *(*FakeGetCommandLine)();
|
||||
|
||||
#define TIER0_NAME FORMAT_SOURCE_BIN_NAME("tier0")
|
||||
@@ -1065,7 +1069,7 @@ CBaseEntity *CHalfLife2::ReferenceToEntity(cell_t entRef)
|
||||
{
|
||||
/* Proper ent reference */
|
||||
int hndlValue = entRef & ~ENTREF_MASK;
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
#if defined(SE_SDK2013_2025)
|
||||
auto hndl = CBaseHandle::UnsafeFromIndex(hndlValue);
|
||||
#else
|
||||
CBaseHandle hndl(hndlValue);
|
||||
@@ -1173,7 +1177,7 @@ int CHalfLife2::ReferenceToIndex(cell_t entRef)
|
||||
{
|
||||
/* Proper ent reference */
|
||||
int hndlValue = entRef & ~ENTREF_MASK;
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
#if defined(SE_SDK2013_2025)
|
||||
auto hndl = CBaseHandle::UnsafeFromIndex(hndlValue);
|
||||
#else
|
||||
CBaseHandle hndl(hndlValue);
|
||||
@@ -1243,7 +1247,7 @@ cell_t CHalfLife2::ReferenceToBCompatRef(cell_t entRef)
|
||||
}
|
||||
|
||||
int hndlValue = entRef & ~ENTREF_MASK;
|
||||
#if SOURCE_ENGINE == SE_TF2
|
||||
#if defined(SE_SDK2013_2025)
|
||||
auto hndl = CBaseHandle::UnsafeFromIndex(hndlValue);
|
||||
#else
|
||||
CBaseHandle hndl(hndlValue);
|
||||
|
||||
+1
-1
Submodule hl2sdk-manifests updated: 20b3a01426...931f7aa578
Reference in New Issue
Block a user