From e7cdb69c588bbce2816c6c7b41181eb05360819d Mon Sep 17 00:00:00 2001 From: "ALLEN-PC\\acj30" Date: Fri, 24 Nov 2023 10:27:48 -0600 Subject: [PATCH] Fix ai_relationship_classify not working properly after loading save --- sp/src/game/server/ai_relationship.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sp/src/game/server/ai_relationship.cpp b/sp/src/game/server/ai_relationship.cpp index 319d5f7e..e5f12d62 100644 --- a/sp/src/game/server/ai_relationship.cpp +++ b/sp/src/game/server/ai_relationship.cpp @@ -532,6 +532,7 @@ public: // Must override CAI_Relationship void Spawn() { m_bIsActive = false; } + void Activate(); bool KeyValue( const char *szKeyName, const char *szValue ); @@ -557,6 +558,19 @@ BEGIN_DATADESC( CAI_ClassRelationship ) END_DATADESC() +//--------------------------------------------------------- +//--------------------------------------------------------- +void CAI_ClassRelationship::Activate() +{ + BaseClass::Activate(); + + // Must re-apply every time a save is loaded + if ( m_bIsActive ) + { + ApplyRelationship(); + } +} + //----------------------------------------------------------------------------- // Purpose: Caches entity key values until spawn is called. // Input : szKeyName -