mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:10:25 +02:00
handle deactivation of avatar entities differently
This commit is contained in:
parent
b7069fff71
commit
5e2a08b3c2
2 changed files with 26 additions and 3 deletions
|
@ -312,11 +312,26 @@ void PhysicalEntitySimulation::handleDeactivatedMotionStates(const VectorOfMotio
|
||||||
assert(state);
|
assert(state);
|
||||||
if (state->getType() == MOTIONSTATE_TYPE_ENTITY) {
|
if (state->getType() == MOTIONSTATE_TYPE_ENTITY) {
|
||||||
EntityMotionState* entityState = static_cast<EntityMotionState*>(state);
|
EntityMotionState* entityState = static_cast<EntityMotionState*>(state);
|
||||||
if (!serverlessMode) {
|
|
||||||
entityState->handleDeactivation();
|
|
||||||
}
|
|
||||||
EntityItemPointer entity = entityState->getEntity();
|
EntityItemPointer entity = entityState->getEntity();
|
||||||
_entitiesToSort.insert(entity);
|
_entitiesToSort.insert(entity);
|
||||||
|
if (!serverlessMode) {
|
||||||
|
if (entity->getClientOnly()) {
|
||||||
|
switch (entityState->getOwnershipState()) {
|
||||||
|
case EntityMotionState::OwnershipState::PendingBid:
|
||||||
|
_bids.removeFirst(entityState);
|
||||||
|
entityState->clearOwnershipState();
|
||||||
|
break;
|
||||||
|
case EntityMotionState::OwnershipState::LocallyOwned:
|
||||||
|
_owned.removeFirst(entityState);
|
||||||
|
entityState->clearOwnershipState();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
entityState->handleDeactivation();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,14 @@ public:
|
||||||
}
|
}
|
||||||
pop_back();
|
pop_back();
|
||||||
}
|
}
|
||||||
|
void removeFirst(EntityMotionState* state) {
|
||||||
|
for (uint32_t i = 0; i < size(); ++i) {
|
||||||
|
if ((*this)[i] == state) {
|
||||||
|
remove(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class PhysicalEntitySimulation : public EntitySimulation {
|
class PhysicalEntitySimulation : public EntitySimulation {
|
||||||
|
|
Loading…
Reference in a new issue