flyingAllowed to zoneAllowsFlying

This commit is contained in:
Matti Lahtinen 2017-06-19 21:44:43 +03:00 committed by GitHub
parent 600a39c9b2
commit 82df64d5e7

View file

@ -590,12 +590,12 @@ void MyAvatar::simulate(float deltaTime) {
auto entityTreeRenderer = qApp->getEntities(); auto entityTreeRenderer = qApp->getEntities();
EntityTreePointer entityTree = entityTreeRenderer ? entityTreeRenderer->getTree() : nullptr; EntityTreePointer entityTree = entityTreeRenderer ? entityTreeRenderer->getTree() : nullptr;
if (entityTree) { if (entityTree) {
bool flyingAllowed = true; bool zoneAllowsFlying = true;
bool collisionlessAllowed = true; bool collisionlessAllowed = true;
entityTree->withWriteLock([&] { entityTree->withWriteLock([&] {
std::shared_ptr<ZoneEntityItem> zone = entityTreeRenderer->myAvatarZone(); std::shared_ptr<ZoneEntityItem> zone = entityTreeRenderer->myAvatarZone();
if (zone) { if (zone) {
flyingAllowed = zone->getFlyingAllowed(); zoneAllowsFlying = zone->getFlyingAllowed();
collisionlessAllowed = zone->getGhostingAllowed(); collisionlessAllowed = zone->getGhostingAllowed();
} }
auto now = usecTimestampNow(); auto now = usecTimestampNow();
@ -626,7 +626,7 @@ void MyAvatar::simulate(float deltaTime) {
entityTree->recurseTreeWithOperator(&moveOperator); entityTree->recurseTreeWithOperator(&moveOperator);
} }
}); });
_characterController.setFlyingAllowed(flyingAllowed && _enableFlying); _characterController.setFlyingAllowed(zoneAllowsFlying && _enableFlying);
_characterController.setCollisionlessAllowed(collisionlessAllowed); _characterController.setCollisionlessAllowed(collisionlessAllowed);
} }