Fix ai_relationship_classify applying before default relationships loaded

This commit is contained in:
ALLEN-PC\acj30 2023-11-03 16:31:09 -05:00
parent aa03b6b51e
commit 0e110b7823
3 changed files with 14 additions and 0 deletions

View File

@ -615,6 +615,9 @@ void CAI_ClassRelationship::ChangeRelationships( int disposition, int iReverting
return;
}
if ( !CBaseCombatCharacter::DefaultRelationshipsLoaded() )
return;
if ( m_iPreviousDisposition == -1 && iReverting == NOT_REVERTING )
{
// Set previous disposition.

View File

@ -3239,6 +3239,16 @@ void CBaseCombatCharacter::SetDefaultRelationship(Class_T nClass, Class_T nClass
}
#ifdef MAPBASE
//-----------------------------------------------------------------------------
// Purpose: Determine whether or not default relationships are loaded
// Input :
// Output :
//-----------------------------------------------------------------------------
bool CBaseCombatCharacter::DefaultRelationshipsLoaded()
{
return m_DefaultRelationship != NULL;
}
//-----------------------------------------------------------------------------
// Purpose: Fetch the default (ignore ai_relationship changes) relationship
// Input :

View File

@ -462,6 +462,7 @@ public:
static void AllocateDefaultRelationships( );
static void SetDefaultRelationship( Class_T nClass, Class_T nClassTarget, Disposition_t nDisposition, int nPriority );
#ifdef MAPBASE
static bool DefaultRelationshipsLoaded();
static Disposition_t GetDefaultRelationshipDisposition( Class_T nClassSource, Class_T nClassTarget );
static int GetDefaultRelationshipPriority( Class_T nClassSource, Class_T nClassTarget );
int GetDefaultRelationshipPriority( Class_T nClassTarget );