mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 22:36:57 +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 {
|
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.
|
// 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()) {
|
for (SpatiallyNestablePointer child : getChildren()) {
|
||||||
if (child && child->getNestableType() == NestableType::Entity) {
|
if (child && child->getNestableType() == NestableType::Entity) {
|
||||||
EntityItemPointer childEntity = std::static_pointer_cast<EntityItem>(child);
|
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
|
// NOTE: null sessionID means "collect ALL known children", else we only collect: local-entities and myAvatar-entities
|
||||||
if (sessionID.isNull() || childEntity->isLocalEntity() || (childEntity->isAvatarEntity() &&
|
if (sessionID.isNull() || childEntity->isLocalEntity() || childEntity->isMyAvatarEntity()) {
|
||||||
(childEntity->isMyAvatarEntity() || childEntity->getOwningAvatarID() == sessionID))) {
|
|
||||||
if (std::find(entitiesToDelete.begin(), entitiesToDelete.end(), childEntity) == entitiesToDelete.end()) {
|
if (std::find(entitiesToDelete.begin(), entitiesToDelete.end(), childEntity) == entitiesToDelete.end()) {
|
||||||
entitiesToDelete.push_back(childEntity);
|
entitiesToDelete.push_back(childEntity);
|
||||||
childEntity->collectChildrenForDelete(entitiesToDelete, sessionID);
|
childEntity->collectChildrenForDelete(entitiesToDelete, sessionID);
|
||||||
|
@ -3417,7 +3416,7 @@ void EntityItem::prepareForSimulationOwnershipBid(EntityItemProperties& properti
|
||||||
properties.setSimulationOwner(Physics::getSessionUUID(), priority);
|
properties.setSimulationOwner(Physics::getSessionUUID(), priority);
|
||||||
setPendingOwnershipPriority(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.setEntityHostType(getEntityHostType());
|
||||||
properties.setOwningAvatarID(getOwningAvatarID());
|
properties.setOwningAvatarID(getOwningAvatarID());
|
||||||
setLastBroadcast(now); // for debug/physics status icons
|
setLastBroadcast(now); // for debug/physics status icons
|
||||||
|
|
Loading…
Reference in a new issue