mirror of
https://github.com/overte-org/overte.git
synced 2025-06-19 12:40:08 +02:00
fix random crash on checkEnterLeaveEntities
This commit is contained in:
parent
bceab4ead9
commit
c1385a9c35
1 changed files with 2 additions and 0 deletions
|
@ -196,6 +196,7 @@ void EntityTreeRenderer::update() {
|
||||||
|
|
||||||
void EntityTreeRenderer::checkEnterLeaveEntities() {
|
void EntityTreeRenderer::checkEnterLeaveEntities() {
|
||||||
if (_tree) {
|
if (_tree) {
|
||||||
|
_tree->lockForRead();
|
||||||
glm::vec3 avatarPosition = Application::getInstance()->getAvatar()->getPosition() / (float) TREE_SCALE;
|
glm::vec3 avatarPosition = Application::getInstance()->getAvatar()->getPosition() / (float) TREE_SCALE;
|
||||||
|
|
||||||
if (avatarPosition != _lastAvatarPosition) {
|
if (avatarPosition != _lastAvatarPosition) {
|
||||||
|
@ -240,6 +241,7 @@ void EntityTreeRenderer::checkEnterLeaveEntities() {
|
||||||
_currentEntitiesInside = entitiesContainingAvatar;
|
_currentEntitiesInside = entitiesContainingAvatar;
|
||||||
_lastAvatarPosition = avatarPosition;
|
_lastAvatarPosition = avatarPosition;
|
||||||
}
|
}
|
||||||
|
_tree->unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue