Skip to content

Commit

Permalink
fix attack command unreliable defaulting bork
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Apr 29, 2021
1 parent 4153285 commit 4f6c646
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -82,9 +82,11 @@ else if (!scriptEntry.hasObject("entities")
if (!scriptEntry.hasObject("target")) {
scriptEntry.addObject("target", Utilities.entryHasPlayer(scriptEntry) ? Utilities.getEntryPlayer(scriptEntry).getDenizenEntity() : null);
}
scriptEntry.defaultObject("entities", Utilities.entryHasNPC(scriptEntry) ? Collections.singletonList(Utilities.getEntryNPC(scriptEntry).getDenizenEntity()) : null);
if (!scriptEntry.hasObject("entities")) {
throw new InvalidArgumentsException("Must specify entity/entities!");
scriptEntry.defaultObject("entities", Utilities.entryHasNPC(scriptEntry) ? Collections.singletonList(Utilities.getEntryNPC(scriptEntry).getDenizenEntity()) : null);
if (!scriptEntry.hasObject("entities")) {
throw new InvalidArgumentsException("Must specify entity/entities!");
}
}
if (!scriptEntry.hasObject("target") && !scriptEntry.hasObject("cancel")) {
throw new InvalidArgumentsException("Must specify a target!");
Expand Down

0 comments on commit 4f6c646

Please sign in to comment.