Fixed: wild exception while replacing ZScript actor from DECORATE

This commit is contained in:
ZZYZX 2017-01-19 09:16:55 +02:00
parent 55b24eef39
commit 819ef6490e
4 changed files with 7 additions and 7 deletions

View file

@ -1946,8 +1946,8 @@ namespace CodeImp.DoomBuilder.Data
// [ZZ] create combined array of actors to process.
IEnumerable<ActorStructure> mergedActors = zscript.Actors.Union(decorate.Actors);
IEnumerable<ActorStructure> mergedAllActors = zscript.AllActors.Union(decorate.AllActors);
Dictionary<string, ActorStructure> mergedActorsByClass = zscript.ActorsByClass.Union(decorate.ActorsByClass).ToDictionary(k => k.Key, v => v.Value);
Dictionary<string, ActorStructure> mergedAllActorsByClass = zscript.AllActorsByClass.Union(decorate.AllActorsByClass).ToDictionary(k => k.Key, v => v.Value);
Dictionary<string, ActorStructure> mergedActorsByClass = decorate.ActorsByClass.Concat(zscript.ActorsByClass.Where(x => !decorate.ActorsByClass.ContainsKey(x.Key))).ToDictionary(k => k.Key, v => v.Value);
Dictionary<string, ActorStructure> mergedAllActorsByClass = decorate.AllActorsByClass.Concat(zscript.AllActorsByClass.Where(x => !decorate.AllActorsByClass.ContainsKey(x.Key))).ToDictionary(k => k.Key, v => v.Value);
zdoomclasses = mergedAllActorsByClass;
// Step 1. Go for all actors in the decorate to make things or update things

View file

@ -30,6 +30,6 @@ using CodeImp.DoomBuilder;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.2834")]
[assembly: AssemblyVersion("2.3.0.2835")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: AssemblyHash("87fdd67")]
[assembly: AssemblyHash("55b24ee")]

View file

@ -30,8 +30,8 @@ namespace CodeImp.DoomBuilder.ZDoom
return;
}
//mxd. Fail on duplicates
if (parser.ActorsByClass.ContainsKey(classname.ToLowerInvariant()))
//mxd. Fail on duplicates // [ZZ] archived +zscript
if (parser.GetArchivedActorByName(classname) != null)
{
parser.ReportError("Actor \"" + classname + "\" is double-defined");
return;

View file

@ -29,5 +29,5 @@ using System.Resources;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.2834")]
[assembly: AssemblyVersion("2.3.0.2835")]
[assembly: NeutralResourcesLanguageAttribute("en")]