Skip to content

Commit d3f8120

Browse files
committed
Fix for dumb logic error
1 parent 5145ef3 commit d3f8120

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

Templates/BaseGame/game/core/lighting.cs

+11-7
Original file line numberDiff line numberDiff line change
@@ -43,20 +43,24 @@ function initLightingSystems(%manager)
4343

4444
// Try to initialize the selected light manager directly
4545
// If this fails, try to initialize the light managers in order from most to least preferable
46-
if (!setLightManager(%manager))
46+
if (setLightManager(%manager))
47+
{
48+
return true;
49+
}
50+
else
4751
{
4852
for(%i = 0; %i < getFieldCount($lightManager::defaults); %i++)
4953
{
5054
%success = setLightManager(getField($lightManager::defaults, %i));
5155

5256
if (%success)
53-
return;
54-
}
57+
return true;
58+
}
59+
60+
// If we completely failed to initialize a light
61+
// manager then the 3d scene cannot be rendered.
62+
quitWithErrorMessage( "Failed to set a light manager!" );
5563
}
56-
57-
// If we completely failed to initialize a light
58-
// manager then the 3d scene cannot be rendered.
59-
quitWithErrorMessage( "Failed to set a light manager!" );
6064
}
6165

6266
//---------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)