Page MenuHomeFeedback Tracker

GetFactionKey() crashes when asking for non-existent faction
New, NormalPublic

Description

Game Version number: Latest stable (1.3.0.157
Modded?: No

In a world with US and USSR faction manager, spawning a FIA (or any other non-existent faction) AI and asking it's factionKey, crashes. Wouldn't it make more sense to return null or <empty>?

SCRIPT (E): Virtual Machine Exception
Reason: NULL pointer to instance. Variable '#return'
Function: 'GetAIAgentFactionKey'

Crash happens after the call to proto external Faction GetAffiliatedFaction();

Details

Severity
Crash
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General
Steps To Reproduce

Create a world with {589540B35EBA8CDC}Prefabs/MP/Managers/Factions/FactionManager_USxUSSR.et

SCR_ChimeraCharacter character = SCR_ChimeraCharacter.Cast(aiAgent.GetControlledEntity());
if (character)
{
faction = character.GetFaction().GetFactionKey();
}

Event Timeline

mokdevel created this task.Thu, May 1, 8:59 AM