From 6a4e11e87147c427dcfe8aa8fc69cf69615f4151 Mon Sep 17 00:00:00 2001 From: FlaminSarge Date: Sat, 26 Apr 2025 22:14:43 -0700 Subject: [PATCH] Resolve vscript naming conflict between CBaseCombatWeapon and CBaseEntity GetName by adding GetTargetname for CBaseEntity This remains fully backwards compatible. --- src/game/server/baseentity.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/server/baseentity.cpp b/src/game/server/baseentity.cpp index 3462fd3700a..00b95d8c7c3 100644 --- a/src/game/server/baseentity.cpp +++ b/src/game/server/baseentity.cpp @@ -2259,7 +2259,8 @@ BEGIN_ENT_SCRIPTDESC_ROOT( CBaseEntity, "Root class of all server-side entities" DEFINE_SCRIPTFUNC_NAMED( ScriptInputKill, "Kill", "" ) DEFINE_SCRIPTFUNC( GetClassname, "" ) - DEFINE_SCRIPTFUNC_NAMED( GetEntityNameAsCStr, "GetName", "" ) + DEFINE_SCRIPTFUNC_NAMED( GetEntityNameAsCStr, "GetName", "!!!LEGACY FOR COMPAT!!! Use GetTargetname" ) + DEFINE_SCRIPTFUNC_NAMED( GetEntityNameAsCStr, "GetTargetname", "" ) DEFINE_SCRIPTFUNC( GetPreTemplateName, "Get the entity name stripped of template unique decoration" ) DEFINE_SCRIPTFUNC_NAMED( ScriptGetEHandle, "GetEntityHandle", "Get the entity as an EHANDLE" )