make it crash nicely when you inherit from a bogus actor type

This commit is contained in:
Chris Forbes
2011-03-30 20:48:09 +13:00
committed by Chris Forbes
parent cee021ef17
commit 1af23079eb
4 changed files with 420 additions and 403 deletions

View File

@@ -39,9 +39,10 @@ namespace OpenRA
return null;
MiniYaml parent;
allUnits.TryGetValue( inherits.Value, out parent );
if( parent == null )
return null;
allUnits.TryGetValue( inherits.Value, out parent );
if (parent == null)
throw new InvalidOperationException(
"Bogus inheritance -- actor type {0} does not exist".F(inherits.Value));
return parent;
}