瀏覽代碼

fix problem with quest time update events

Kolja Strohm 2 天之前
父節點
當前提交
844ed18558
共有 1 個文件被更改,包括 17 次插入4 次删除
  1. 17 4
      FactoryCraft/Quest.cpp

+ 17 - 4
FactoryCraft/Quest.cpp

@@ -843,12 +843,25 @@ void QuestManager::saveQuests()
 
 void QuestManager::processEvent(QuestEvent* event)
 {
-    QuestParty* party = zParty(event->zActingEntity()->getId());
-    if (party)
+    if (!event->zActingEntity())
     {
-        for (QuestCollection* questCollection : questCollections)
+        for (QuestParty* party : parties)
         {
-            questCollection->processEvent(event, party);
+            for (QuestCollection* questCollection : questCollections)
+            {
+                questCollection->processEvent(event, party);
+            }
+        }
+    }
+    else
+    {
+        QuestParty* party = zParty(event->zActingEntity()->getId());
+        if (party)
+        {
+            for (QuestCollection* questCollection : questCollections)
+            {
+                questCollection->processEvent(event, party);
+            }
         }
     }
     event->release();