mirror of
https://github.com/mapbase-source/source-sdk-2013.git
synced 2024-12-26 06:45:31 +03:00
Added sequence check and backup activity fallback to companion NPC readiness activities
This commit is contained in:
parent
2c55c6cea7
commit
a2c2fe09d5
@ -1650,6 +1650,19 @@ Activity CNPC_PlayerCompanion::TranslateActivityReadiness( Activity activity )
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef MAPBASE
|
||||
// If we don't have the readiness activity we selected and there's no backup activity available, break the loop and return the base act.
|
||||
bool bRequired;
|
||||
if ( !HaveSequenceForActivity( actremap.mappedActivity ) && !HaveSequenceForActivity( Weapon_TranslateActivity( actremap.mappedActivity, &bRequired ) ) )
|
||||
{
|
||||
Activity backupAct = Weapon_BackupActivity( actremap.mappedActivity, bRequired );
|
||||
if ( backupAct != actremap.mappedActivity )
|
||||
return backupAct;
|
||||
else
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
// We've successfully passed all criteria for remapping this
|
||||
return actremap.mappedActivity;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user