diff --git a/Templates/BaseGame/game/core/lighting.cs b/Templates/BaseGame/game/core/lighting.cs index 295766a5db..ca890b3f40 100644 --- a/Templates/BaseGame/game/core/lighting.cs +++ b/Templates/BaseGame/game/core/lighting.cs @@ -43,20 +43,24 @@ function initLightingSystems(%manager) // Try to initialize the selected light manager directly // If this fails, try to initialize the light managers in order from most to least preferable - if (!setLightManager(%manager)) + if (setLightManager(%manager)) + { + return true; + } + else { for(%i = 0; %i < getFieldCount($lightManager::defaults); %i++) { %success = setLightManager(getField($lightManager::defaults, %i)); if (%success) - return; - } + return true; + } + + // If we completely failed to initialize a light + // manager then the 3d scene cannot be rendered. + quitWithErrorMessage( "Failed to set a light manager!" ); } - - // If we completely failed to initialize a light - // manager then the 3d scene cannot be rendered. - quitWithErrorMessage( "Failed to set a light manager!" ); } //---------------------------------------------------------------------------------------------