Remove unnecessary conditionals

- Game.modData.Manifest.LuaScripts is never null.
- context.LoadLuaScripts will work properly even if the file collection is empty.
This commit is contained in:
Jacob Dufault
2014-09-23 22:58:11 -04:00
parent 8d54efc7af
commit 67ff4dbac1

View File

@@ -63,9 +63,7 @@ namespace OpenRA.Mods.RA.Scripting
context.RegisterType(typeof(int2), "int2", true); context.RegisterType(typeof(int2), "int2", true);
context.RegisterType(typeof(float2), "float2", true); context.RegisterType(typeof(float2), "float2", true);
var sharedScripts = Game.modData.Manifest.LuaScripts ?? new string[0]; context.LoadLuaScripts(f => GlobalFileSystem.Open(f).ReadAllText(), Game.modData.Manifest.LuaScripts);
if (sharedScripts.Any())
context.LoadLuaScripts(f => GlobalFileSystem.Open(f).ReadAllText(), sharedScripts);
AddMapActorGlobals(); AddMapActorGlobals();