2 Ревизии d6291a5fdc ... 09e2efddc9

Автор SHA1 Съобщение Дата
  Kolja Strohm 09e2efddc9 fix deadlock of entity tick thread with client api call processing thread преди 1 месец
  Kolja Strohm 1c1747ac4b fix entity jumps were not send to opservers преди 1 месец
променени са 2 файла, в които са добавени 7 реда и са изтрити 2 реда
  1. 4 0
      FactoryCraft/Entity.cpp
  2. 3 2
      FactoryCraft/InformationObserver.cpp

+ 4 - 0
FactoryCraft/Entity.cpp

@@ -1154,6 +1154,10 @@ void Entity::tick(const Dimension* zDimension, double seconds)
                 }
                 location.z -= moveDir.z;
             }
+            else
+            {
+                changed = 1;
+            }
         }
     }
     if (movementFlags & MovementFlags::GROUND_CONTACT)

+ 3 - 2
FactoryCraft/InformationObserver.cpp

@@ -48,14 +48,15 @@ bool InformationObserver::sendMessage(NetworkMessage* message)
 
 void InformationObserver::setReady()
 {
+    Entity* e = Game::INSTANCE->zEntity(entityId);
     cs.lock();
     ready = 1;
-    Entity* e = Game::INSTANCE->zEntity(entityId);
     if (e)
     {
         for (NetworkMessage* msg : waitingMessages)
         {
-            Game::INSTANCE->sendMessage(dynamic_cast<NetworkMessage*>(msg->getThis()), e);
+            Game::INSTANCE->sendMessage(
+                dynamic_cast<NetworkMessage*>(msg->getThis()), e);
         }
     }
     waitingMessages.leeren();