From d0c4657b75c55eb55d50277970a9132133460a64 Mon Sep 17 00:00:00 2001 From: Nick Hastings Date: Sat, 2 Oct 2021 11:18:23 -0400 Subject: [PATCH] Add ValveType_Object type. This is for the few cases where we have function parameters to objects that don't fit our other predefined types (CBaseEntity, CBasePlayer, string). Most calls currently pass those as POD (which is incorrect, but works on x86), or one of the other pointer types (which is also incorrect, and can lead to confusion, but works on x86 and x86-64). This type only works when manually buffering the parameter for calls, and is not supported for return types. --- extensions/sdktools/vdecoder.cpp | 1 + extensions/sdktools/vdecoder.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/sdktools/vdecoder.cpp b/extensions/sdktools/vdecoder.cpp index 98e43e09..7bdf2ef0 100644 --- a/extensions/sdktools/vdecoder.cpp +++ b/extensions/sdktools/vdecoder.cpp @@ -110,6 +110,7 @@ size_t ValveParamToBinParam(ValveType type, case Valve_CBasePlayer: case Valve_Edict: case Valve_String: + case Valve_Object: { if (pass != PassType_Basic || (flags & PASSFLAG_BYREF)) { diff --git a/extensions/sdktools/vdecoder.h b/extensions/sdktools/vdecoder.h index c7836089..643cee67 100644 --- a/extensions/sdktools/vdecoder.h +++ b/extensions/sdktools/vdecoder.h @@ -48,11 +48,12 @@ enum ValveType Valve_CBasePlayer, /**< CBasePlayer (disallow normal ents) */ Valve_Vector, /**< Vector */ Valve_QAngle, /**< QAngle */ - Valve_POD, /**< Plain old data */ + Valve_POD, /**< Plain old data, int32 size */ Valve_Float, /**< Float */ Valve_Edict, /**< Edict */ Valve_String, /**< String */ Valve_Bool, /**< Boolean */ + Valve_Object, /**< Object, not matching one of the above types */ }; enum DataStatus