Ver Fonte

fix problem with quest time update events

Kolja Strohm há 2 dias atrás
pai
commit
844ed18558
1 ficheiros alterados com 17 adições e 4 exclusões
  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();