Skip to content

Commit

Permalink
Removed scan-down of subscenes from Scene's getObjectsByClass call
Browse files Browse the repository at this point in the history
Properly returned value for SubScene::save()
  • Loading branch information
Areloch committed Sep 1, 2024
1 parent ae8eca4 commit d896a2b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Engine/source/T3D/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ void Scene::getUtilizedAssetsFromSceneObject(SimObject* object, Vector<StringTab
}

//
Vector<SceneObject*> Scene::getObjectsByClass(String className, bool checkSubscenes)
Vector<SceneObject*> Scene::getObjectsByClass(String className)
{
return Vector<SceneObject*>();
}
Expand Down
19 changes: 3 additions & 16 deletions Engine/source/T3D/Scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class Scene : public NetObject, public virtual ITickable
void unpackUpdate(NetConnection *conn, BitStream *stream) override;

//
Vector<SceneObject*> getObjectsByClass(String className, bool checkSubscenes);
Vector<SceneObject*> getObjectsByClass(String className);

void getUtilizedAssetsFromSceneObject(SimObject* object, Vector<StringTableEntry>* usedAssetsList);

template <class T>
Vector<T*> getObjectsByClass(bool checkSubscenes);
Vector<T*> getObjectsByClass();

static Scene *getRootScene()
{
Expand All @@ -108,7 +108,7 @@ class Scene : public NetObject, public virtual ITickable


template <class T>
Vector<T*> Scene::getObjectsByClass(bool checkSubscenes)
Vector<T*> Scene::getObjectsByClass()
{
Vector<T*> foundObjects;

Expand All @@ -129,19 +129,6 @@ Vector<T*> Scene::getObjectsByClass(bool checkSubscenes)
foundObjects.push_back(curObject);
}

if (checkSubscenes)
{
for (U32 i = 0; i < mSubScenes.size(); i++)
{
Vector<T*> appendList = mSubScenes[i]->getObjectsByClass<T>(true);

for (U32 a = 0; a < appendList.size(); a++)
{
foundObjects.push_back(appendList[a]);
}
}
}

return foundObjects;
}
#endif
1 change: 1 addition & 0 deletions Engine/source/T3D/SubScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ bool SubScene::save()
//Finally, save
saveSuccess = mLevelAsset->saveAsset();

return saveSuccess;
}

void SubScene::_onSelected()
Expand Down

0 comments on commit d896a2b

Please sign in to comment.