better error when no sequences defined at all
This commit is contained in:
@@ -56,8 +56,12 @@ namespace OpenRA.Graphics
|
|||||||
try { return units[unitName][sequenceName]; }
|
try { return units[unitName][sequenceName]; }
|
||||||
catch (KeyNotFoundException)
|
catch (KeyNotFoundException)
|
||||||
{
|
{
|
||||||
|
if (units.ContainsKey(unitName))
|
||||||
throw new InvalidOperationException(
|
throw new InvalidOperationException(
|
||||||
"Unit `{0}` does not have a sequence `{1}`".F(unitName, sequenceName));
|
"Unit `{0}` does not have a sequence `{1}`".F(unitName, sequenceName));
|
||||||
|
else
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
"Unit `{0}` does not have any sequences defined.".F(unitName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user