mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 22:30:42 +02:00
fix flawed logic in updateEntityQueryAACubeWorker
This commit is contained in:
parent
38cc2205ec
commit
bc5079e5d7
1 changed files with 21 additions and 23 deletions
|
@ -2962,30 +2962,28 @@ bool EntityTree::removeMaterialFromOverlay(const QUuid& overlayID, graphics::Mat
|
|||
void EntityTree::updateEntityQueryAACubeWorker(SpatiallyNestablePointer object, EntityEditPacketSender* packetSender,
|
||||
MovingEntitiesOperator& moveOperator, bool force, bool tellServer) {
|
||||
// if the queryBox has changed, tell the entity-server
|
||||
if (object->getNestableType() == NestableType::Entity && object->updateQueryAACube()) {
|
||||
EntityItemPointer entity = std::static_pointer_cast<EntityItem>(object);
|
||||
if (entity->updateQueryAACube() || force) {
|
||||
bool success;
|
||||
AACube newCube = entity->getQueryAACube(success);
|
||||
if (success) {
|
||||
moveOperator.addEntityToMoveList(entity, newCube);
|
||||
}
|
||||
// send an edit packet to update the entity-server about the queryAABox
|
||||
// unless it is client-only
|
||||
if (tellServer && packetSender && entity->isDomainEntity()) {
|
||||
quint64 now = usecTimestampNow();
|
||||
EntityItemProperties properties = entity->getProperties();
|
||||
properties.setQueryAACubeDirty();
|
||||
properties.setLocationDirty();
|
||||
properties.setLastEdited(now);
|
||||
|
||||
packetSender->queueEditEntityMessage(PacketType::EntityEdit, getThisPointer(), entity->getID(), properties);
|
||||
entity->setLastBroadcast(now); // for debug/physics status icons
|
||||
}
|
||||
|
||||
entity->markDirtyFlags(Simulation::DIRTY_POSITION);
|
||||
entityChanged(entity);
|
||||
EntityItemPointer entity = std::dynamic_pointer_cast<EntityItem>(object);
|
||||
if (entity && (entity->updateQueryAACube() || force)) {
|
||||
bool success;
|
||||
AACube newCube = entity->getQueryAACube(success);
|
||||
if (success) {
|
||||
moveOperator.addEntityToMoveList(entity, newCube);
|
||||
}
|
||||
// send an edit packet to update the entity-server about the queryAABox
|
||||
// unless it is client-only
|
||||
if (tellServer && packetSender && entity->isDomainEntity()) {
|
||||
quint64 now = usecTimestampNow();
|
||||
EntityItemProperties properties = entity->getProperties();
|
||||
properties.setQueryAACubeDirty();
|
||||
properties.setLocationDirty();
|
||||
properties.setLastEdited(now);
|
||||
|
||||
packetSender->queueEditEntityMessage(PacketType::EntityEdit, getThisPointer(), entity->getID(), properties);
|
||||
entity->setLastBroadcast(now); // for debug/physics status icons
|
||||
}
|
||||
|
||||
entity->markDirtyFlags(Simulation::DIRTY_POSITION);
|
||||
entityChanged(entity);
|
||||
}
|
||||
|
||||
object->forEachDescendant([&](SpatiallyNestablePointer descendant) {
|
||||
|
|
Loading…
Reference in a new issue