Log unknown orders instead of crashing with an NIE

This commit is contained in:
Oliver Brakmann
2016-09-26 20:39:01 +02:00
parent ae6b82a677
commit d1ef1ed1ba

View File

@@ -64,7 +64,8 @@ namespace OpenRA
public static Order Deserialize(World world, BinaryReader r)
{
switch (r.ReadByte())
var magic = r.ReadByte();
switch (magic)
{
case 0xFF:
{
@@ -98,7 +99,10 @@ namespace OpenRA
}
default:
throw new NotImplementedException();
{
Log.Write("debug", "Received unknown order with magic {0}", magic);
return null;
}
}
}