Fixed a crash when saving a map with changed, but not recompiled SCRIPTS lump.

This commit is contained in:
MaxED 2016-05-14 01:26:22 +00:00
parent c06443c7d1
commit b84e36b55a

View file

@ -1968,11 +1968,26 @@ namespace CodeImp.DoomBuilder
foreach(MapLumpInfo lumpinfo in config.MapLumps.Values)
{
// Is this a script lump?
if(lumpinfo.Script != null || lumpinfo.ScriptBuild)
if(lumpinfo.Script != null)
{
// Compile it now
success &= tempwadreader.CompileLump(lumpinfo.Name, lumpinfo.Script, errors);
}
//mxd. Is this ACS script?
else if(lumpinfo.ScriptBuild)
{
// Compile it using selected script compiler
ScriptConfiguration cfg = General.GetScriptConfiguration(ScriptType.ACS);
if(cfg != null)
{
success &= tempwadreader.CompileLump(lumpinfo.Name, cfg, errors);
}
else
{
General.ErrorLogger.Add(ErrorType.Error, "Unable to compile \"" + lumpinfo.Name + "\" script lump: unable to find suitable Script Configuration!");
success = false;
}
}
}
return success;