mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 09:43:01 +02:00
remove redundant checks in 'if' clause
This commit is contained in:
parent
b231dadba5
commit
b5ca93a019
1 changed files with 4 additions and 5 deletions
|
@ -3237,13 +3237,12 @@ void EntityItem::retrieveMarketplacePublicKey() {
|
|||
|
||||
void EntityItem::collectChildrenForDelete(std::vector<EntityItemPointer>& entitiesToDelete, const QUuid& sessionID) const {
|
||||
// Deleting an entity has consequences for its children, however there are rules dictating what can be deleted.
|
||||
// This method helps enforce those rules for the children of entity (not for this entity).
|
||||
// This method helps enforce those rules: not for this entity, but for its children.
|
||||
for (SpatiallyNestablePointer child : getChildren()) {
|
||||
if (child && child->getNestableType() == NestableType::Entity) {
|
||||
EntityItemPointer childEntity = std::static_pointer_cast<EntityItem>(child);
|
||||
// NOTE: null sessionID means "collect ALL known entities", else we only collect: local-entities and authorized avatar-entities
|
||||
if (sessionID.isNull() || childEntity->isLocalEntity() || (childEntity->isAvatarEntity() &&
|
||||
(childEntity->isMyAvatarEntity() || childEntity->getOwningAvatarID() == sessionID))) {
|
||||
// NOTE: null sessionID means "collect ALL known children", else we only collect: local-entities and myAvatar-entities
|
||||
if (sessionID.isNull() || childEntity->isLocalEntity() || childEntity->isMyAvatarEntity()) {
|
||||
if (std::find(entitiesToDelete.begin(), entitiesToDelete.end(), childEntity) == entitiesToDelete.end()) {
|
||||
entitiesToDelete.push_back(childEntity);
|
||||
childEntity->collectChildrenForDelete(entitiesToDelete, sessionID);
|
||||
|
@ -3417,7 +3416,7 @@ void EntityItem::prepareForSimulationOwnershipBid(EntityItemProperties& properti
|
|||
properties.setSimulationOwner(Physics::getSessionUUID(), priority);
|
||||
setPendingOwnershipPriority(priority);
|
||||
|
||||
// ANDREW TODO: figure out if it would be OK to NOT bother set these properties here
|
||||
// TODO: figure out if it would be OK to NOT bother set these properties here
|
||||
properties.setEntityHostType(getEntityHostType());
|
||||
properties.setOwningAvatarID(getOwningAvatarID());
|
||||
setLastBroadcast(now); // for debug/physics status icons
|
||||
|
|
Loading…
Reference in a new issue