From 13538006ec1a06bb3962a920b961178f5c77c25a Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Tue, 2 Jan 2018 09:17:56 -0800 Subject: [PATCH] fix bug preventing sim owenrship on local domain --- libraries/entities/src/EntityItem.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index d1842b6fbe..91e26d0a3c 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -686,18 +686,18 @@ int EntityItem::readEntityDataFromBuffer(const unsigned char* data, int bytesLef weOwnSimulation = _simulationOwner.matchesValidID(myNodeID); } } else if (_simulationOwner.pendingTake(now - maxPingRoundTrip)) { - // we sent a bid before this packet could have been sent from the server - // so we ignore it and pretend we own the object's simulation + // we sent a bid already but maybe before this packet was sent from the server weOwnSimulation = true; if (newSimOwner.getID().isNull()) { - // entity-server is trying to clear someone else's ownership - // but we want to own it, therefore we ignore this clear event + // the entity-server is trying to clear someone else's ownership if (!_simulationOwner.isNull()) { - // someone else really did own it markDirtyFlags(Simulation::DIRTY_SIMULATOR_ID); somethingChanged = true; _simulationOwner.clearCurrentOwner(); } + } else if (newSimOwner.getID() == myNodeID) { + // the entity-server is awarding us ownership which is what we want + _simulationOwner.set(newSimOwner); } } else if (newSimOwner.matchesValidID(myNodeID) && !_hasBidOnSimulation) { // entity-server tells us that we have simulation ownership while we never requested this for this EntityItem,