diff --git a/OpenRA.Editor/LegacyMapImporter.cs b/OpenRA.Editor/LegacyMapImporter.cs index 5afaeccba7..4476c78161 100644 --- a/OpenRA.Editor/LegacyMapImporter.cs +++ b/OpenRA.Editor/LegacyMapImporter.cs @@ -15,6 +15,7 @@ using System.Linq; using System.Text; using OpenRA; using OpenRA.FileFormats; +using OpenRA.Traits; namespace OpenRA.Editor { @@ -346,16 +347,21 @@ namespace OpenRA.Editor { foreach (var s in file.GetSection(section, true)) { - //num=owner,type,health,location,facing,... + //Structures: num=owner,type,health,location,turret-facing,trigger + //Units: num=owner,type,health,location,facing,action,trigger + //Infantry: num=owner,type,health,location,subcell,action,facing,trigger var parts = s.Value.Split(','); var loc = int.Parse(parts[3]); if (parts[0] == "") parts[0] = "Neutral"; + Map.Actors.Add("Actor" + ActorCount++, new ActorReference(parts[1].ToLowerInvariant()) { new LocationInit(new int2(loc % MapSize, loc / MapSize)), - new OwnerInit(parts[0]) + new OwnerInit(parts[0]), + new HealthInit(float.Parse(parts[2])/256), + new FacingInit((section == "INFANTRY") ? int.Parse(parts[6]) : int.Parse(parts[4])), }); } } diff --git a/OpenRA.Game/ActorReference.cs b/OpenRA.Game/ActorReference.cs index e0d0ebe92e..d81b1a50e9 100755 --- a/OpenRA.Game/ActorReference.cs +++ b/OpenRA.Game/ActorReference.cs @@ -23,7 +23,7 @@ namespace OpenRA.FileFormats public ActorReference( string type, Dictionary inits ) { - if (!Rules.Info.ContainsKey(type)) + if (Rules.Info != null && !Rules.Info.ContainsKey(type)) throw new InvalidDataException("Unknown actor: `{0}'".F(type)); Type = type;