I noticed that if I kill the target npc without taking the quest, then there will be a null reference error and the target will not “die”. Their mover will be disabled, but they will still whack at you if you get in attack range.
In my game, I would like npcs to exist (or in this case unexist) independent of the player’s quests, so I made one tiny update by adding a check for HasQuest() to CompletedObjective():
public void CompleteObjective(Quest quest, string objective)
{
if (!HasQuest(quest)) return;
QuestStatus status = GetQuestStatus(quest);
status.CompleteObjective(objective);
if (status.IsComplete())
{
GiveReward(quest);
}
if (onUpdate != null)
{
onUpdate();
}
}
This way, you can still fight and kill a quest target without taking the quest. This could be helpful in situations were you would need to kill an NPC but may have missed the quest when you were back in town.
Curious if anyone else ran into this bug, and how they solved it?