Ignore nonexistent actors in D2k importer code instead of crashing.

This commit is contained in:
Mustafa Alperen Seki
2022-06-24 21:22:26 +01:00
committed by Paul Chote
parent 6083eb4ac8
commit c15af9f68a

View File

@@ -371,8 +371,9 @@ namespace OpenRA.Mods.D2k.UtilityCommands
{
var kvp = ActorDataByActorCode[tileSpecialInfo];
if (!rules.Actors.ContainsKey(kvp.Actor.ToLowerInvariant()))
throw new InvalidOperationException($"Actor with name {kvp.Actor} could not be found in the rules YAML file!");
Console.WriteLine($"Ignoring unknown actor type: `{kvp.Actor.ToLowerInvariant()}`");
else
{
var a = new ActorReference(kvp.Actor)
{
new LocationInit(locationOnMap),
@@ -402,6 +403,7 @@ namespace OpenRA.Mods.D2k.UtilityCommands
}
}
}
}
CPos GetCurrentTilePositionOnMap()
{