better error when no sequences defined at all

This commit is contained in:
Chris Forbes
2011-01-21 13:55:31 +13:00
committed by Paul Chote
parent 272ba08c21
commit b7ea695f0c

View File

@@ -56,8 +56,12 @@ namespace OpenRA.Graphics
try { return units[unitName][sequenceName]; }
catch (KeyNotFoundException)
{
if (units.ContainsKey(unitName))
throw new InvalidOperationException(
"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));
}
}