Skip to content

Commit

Permalink
Merge pull request armory3d#195 from MoritzBrueckner/fix-group-loading
Browse files Browse the repository at this point in the history
Fix black screen and display warning if referenced group doesn't exist
  • Loading branch information
luboslenco authored Jul 7, 2023
2 parents 854b04b + 1d28f25 commit b24bfd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Sources/iron/Scene.hx
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ class Scene {
var object = addObject(parent);
returnObject(object, o, function(ro: Object) {
if (o.group_ref != null) { // Instantiate group objects
spawnGroup(format, o.group_ref, ro, function() { done(ro); });
spawnGroup(format, o.group_ref, ro, () -> done(ro), () -> done(ro) /* also call done when failed to ensure loading progress */);
}
else done(ro);
});
Expand All @@ -586,6 +586,7 @@ class Scene {
var object_refs = getGroupObjectRefs(groupRef, format);

if (object_refs == null) { // Group doesn't exist
trace('Failed to spawn group "$groupRef", group doesn\'t exist');
if (failed != null) failed();
}
else if (object_refs.length == 0) {
Expand Down

0 comments on commit b24bfd8

Please sign in to comment.