addressing code review requests

This commit is contained in:
Dante Ruiz 2019-01-14 14:04:01 -08:00
parent e7d3844620
commit 4ab7308669
2 changed files with 4 additions and 2 deletions

View file

@ -203,7 +203,7 @@ void EntityTreeRenderer::stopNonLocalEntityScripts() {
if (_entitiesScriptEngine) {
QList<EntityItemID> entitiesWithEntityScripts = _entitiesScriptEngine->getListOfEntityScriptIDs();
foreach (EntityItemID entityID, entitiesWithEntityScripts) {
foreach (const EntityItemID& entityID, entitiesWithEntityScripts) {
EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID);
if (entityItem) {
@ -664,7 +664,7 @@ bool EntityTreeRenderer::checkEnterLeaveEntities() {
void EntityTreeRenderer::leaveNonLocalEntities() {
if (_tree && !_shuttingDown) {
QVector<EntityItemID> currentLocalEntitiesInside;
foreach (EntityItemID entityID, _currentEntitiesInside) {
foreach (const EntityItemID& entityID, _currentEntitiesInside) {
EntityItemPointer entityItem = getTree()->findEntityByEntityItemID(entityID);
if (!entityItem->isLocalEntity()) {
emit leaveEntity(entityID);

View file

@ -74,6 +74,8 @@ void EntityTree::eraseNonLocalEntities() {
emit clearingEntities();
if (_simulation) {
// This will clear all entities host types including local entities, because local entities
// are not in the physics simulation
_simulation->clearEntities();
}
_staleProxies.clear();