Beispiel #1
0
        public void Destroy()
        {
            if (Quests != null)
            {
                for (int i = 0; i < Quests.Count; i++)
                {
                    Quest quest = Quests[i];
                    if (quest != null)
                    {
                        if (quest.Site != null)
                        {
                            quest.Site.EndQuest(null, EndCondition.None);
                        }
                        else
                        {
                            quest.EndQuest(null, EndCondition.None);
                        }
                    }
                }
            }

            if (Dialogs != null)
            {
                for (int i = 0; i < Dialogs.Count; i++)
                {
                    CommunicationDialog dialog = Dialogs[i];
                    if (!dialog.ShowInConsole)
                    {
                        dialog.Destroy();
                    }
                }
            }

            QuestsManager.Communications.RemoveQuestPawn(this);
        }
Beispiel #2
0
        public void EndQuest(Caravan caravan = null, EndCondition condition = EndCondition.None)
        {
            quest.EndQuest(caravan, condition);

            if (Find.WorldObjects.Contains(this))
            {
                Find.WorldObjects.Remove(this);
            }
        }
        public override void TraderGone()
        {
            if (Quests != null)
            {
                for (int i = 0; i < Quests.Count; i++)
                {
                    QuestRim.Quest quest = Quests[i];
                    if (quest != null)
                    {
                        if (quest.Site != null)
                        {
                            quest.Site.EndQuest(null, EndCondition.None);
                        }
                        else
                        {
                            quest.EndQuest(null, EndCondition.None);
                        }
                    }
                }
            }
            Quests.Clear();

            base.TraderGone();
        }