Check for valid power names

This commit is contained in:
Jaculabilis 2022-12-31 13:52:30 -08:00 committed by Tim Van Baak
parent c1237e1f67
commit 73a8934201
1 changed files with 7 additions and 2 deletions

View File

@ -62,8 +62,13 @@ public class GameScriptHandler : IScriptHandler
break; break;
case "orders": case "orders":
if (World.Powers.Any(p => p.Name == args[1]))
{
var handler = new OrderSetScriptHandler(this, World, input); var handler = new OrderSetScriptHandler(this, World, input);
return handler; return handler;
}
Console.WriteLine("Unrecognized power");
break;
default: default:
Console.WriteLine("Unrecognized command"); Console.WriteLine("Unrecognized command");