mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 09:48:44 +02:00
Fix entity lifetime guards (re: canRez/canRezTmp)
This commit is contained in:
parent
c297fa7c0e
commit
e65e6dc9ce
1 changed files with 6 additions and 4 deletions
|
@ -150,8 +150,10 @@ bool EntityTree::updateEntityWithElement(EntityItemPointer entity, const EntityI
|
||||||
|
|
||||||
if (!canRezPermanentEntities && (entity->getLifetime() != properties.getLifetime())) {
|
if (!canRezPermanentEntities && (entity->getLifetime() != properties.getLifetime())) {
|
||||||
// we don't allow a Node that can't create permanent entities to adjust lifetimes on existing ones
|
// we don't allow a Node that can't create permanent entities to adjust lifetimes on existing ones
|
||||||
qCDebug(entities) << "Refusing disallowed entity lifetime adjustment.";
|
if (properties.lifetimeChanged()) {
|
||||||
return false;
|
qCDebug(entities) << "Refusing disallowed entity lifetime adjustment.";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// enforce support for locked entities. If an entity is currently locked, then the only
|
// enforce support for locked entities. If an entity is currently locked, then the only
|
||||||
|
@ -322,8 +324,8 @@ bool EntityTree::updateEntityWithElement(EntityItemPointer entity, const EntityI
|
||||||
bool EntityTree::permissionsAllowRez(const EntityItemProperties& properties, bool canRez, bool canRezTmp) {
|
bool EntityTree::permissionsAllowRez(const EntityItemProperties& properties, bool canRez, bool canRezTmp) {
|
||||||
float lifeTime = properties.getLifetime();
|
float lifeTime = properties.getLifetime();
|
||||||
|
|
||||||
if (lifeTime == 0.0f || lifeTime > _maxTmpEntityLifetime) {
|
if (lifeTime == ENTITY_ITEM_IMMORTAL_LIFETIME || lifeTime > _maxTmpEntityLifetime) {
|
||||||
// this is an attempt to rez a permanent entity.
|
// this is an attempt to rez a permanent or non-temporary entity.
|
||||||
if (!canRez) {
|
if (!canRez) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue