From 6a0a0154c676d14d52530e089020af49b0e4e557 Mon Sep 17 00:00:00 2001 From: "ALLEN-PC\\acj30" Date: Fri, 24 Nov 2023 10:45:56 -0600 Subject: [PATCH] SetClassRelationship function for VScript --- sp/src/game/server/basecombatcharacter.cpp | 8 ++++++++ sp/src/game/server/basecombatcharacter.h | 1 + 2 files changed, 9 insertions(+) diff --git a/sp/src/game/server/basecombatcharacter.cpp b/sp/src/game/server/basecombatcharacter.cpp index c71d89f4..5d2c692c 100644 --- a/sp/src/game/server/basecombatcharacter.cpp +++ b/sp/src/game/server/basecombatcharacter.cpp @@ -175,6 +175,7 @@ BEGIN_ENT_SCRIPTDESC( CBaseCombatCharacter, CBaseFlex, "The base class shared by DEFINE_SCRIPTFUNC_NAMED( ScriptRelationType, "GetRelationship", "Get a character's relationship to a specific entity." ) DEFINE_SCRIPTFUNC_NAMED( ScriptRelationPriority, "GetRelationPriority", "Get a character's relationship priority for a specific entity." ) DEFINE_SCRIPTFUNC_NAMED( ScriptSetRelationship, "SetRelationship", "Set a character's relationship with a specific entity." ) + DEFINE_SCRIPTFUNC_NAMED( ScriptSetClassRelationship, "SetClassRelationship", "Set a character's relationship with a specific Classify() class." ) DEFINE_SCRIPTFUNC_NAMED( ScriptGetVehicleEntity, "GetVehicleEntity", "Get the entity for a character's current vehicle if they're in one." ) @@ -4663,6 +4664,13 @@ void CBaseCombatCharacter::ScriptSetRelationship( HSCRIPT pTarget, int dispositi AddEntityRelationship( ToEnt( pTarget ), (Disposition_t)disposition, priority ); } +//----------------------------------------------------------------------------- +//----------------------------------------------------------------------------- +void CBaseCombatCharacter::ScriptSetClassRelationship( int classify, int disposition, int priority ) +{ + AddClassRelationship( (Class_T)classify, (Disposition_t)disposition, priority); +} + //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- HSCRIPT CBaseCombatCharacter::ScriptGetVehicleEntity() diff --git a/sp/src/game/server/basecombatcharacter.h b/sp/src/game/server/basecombatcharacter.h index ccd5d599..22f07eb9 100644 --- a/sp/src/game/server/basecombatcharacter.h +++ b/sp/src/game/server/basecombatcharacter.h @@ -440,6 +440,7 @@ public: int ScriptRelationType( HSCRIPT pTarget ); int ScriptRelationPriority( HSCRIPT pTarget ); void ScriptSetRelationship( HSCRIPT pTarget, int disposition, int priority ); + void ScriptSetClassRelationship( int classify, int disposition, int priority ); HSCRIPT ScriptGetVehicleEntity();