File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -102,25 +102,33 @@ bool SceneFile::Deserialise(std::vector<Entity*>& entities)
102
102
};
103
103
104
104
// TODO: Implement proper write-mode handling for scene system
105
+ String ScenePath = MakeScenePath (sceneName);
105
106
if (!SceneSystem::GetBaseDirectory ().IsEmpty ())
106
107
{
107
108
bool result = FileSystem::ForEachFileInDir (
108
- MakeScenePath (sceneName) ,
109
+ ScenePath ,
109
110
[&deserialiseEntityString](const std::filesystem::path& path) {
110
111
if (path.extension () != ENTITY_FILE_EXT) return ;
111
112
String entityData = FileSystem::Read (path.c_str ());
112
113
deserialiseEntityString (entityData, path);
113
114
});
114
115
if (!result)
115
116
{
116
- CC_LOG_ERROR (" Failed to read scene file at path \" {}\" " , MakeScenePath (sceneName) )
117
+ CC_LOG_ERROR (" Failed to read scene file at path \" {}\" " , ScenePath )
117
118
return false ;
118
119
}
119
120
}
120
121
else
121
122
{
122
123
PackFile* packFile = ResourceSystem::GetInstance ().GetPackFile ();
123
- SceneData* sceneData = packFile->FindData <SceneData>(MakeScenePath (sceneName));
124
+
125
+ SceneData* sceneData = packFile->FindData <SceneData>(ScenePath);
126
+ if (!sceneData)
127
+ {
128
+ CC_LOG_WARNING (" Failed to find scene \" {}\" in pack file" , ScenePath)
129
+ return false ;
130
+ }
131
+
124
132
String sceneString (sceneData->data );
125
133
for (const String& entityData : sceneString.Split (' |' ))
126
134
{
You can’t perform that action at this time.
0 commit comments