Skip to content

Commit

Permalink
entity damage match conflict reduction
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 11, 2021
1 parent 2c5849d commit cb809c7
Showing 1 changed file with 14 additions and 1 deletion.
Expand Up @@ -84,7 +84,20 @@ public EntityDamagedScriptEvent() {
@Override
public boolean couldMatch(ScriptPath path) {
String cmd = path.eventArgLowerAt(1);
if (!cmd.equals("damaged") && !cmd.equals("damages")) {
if (cmd.equals("damaged")) {
if (path.eventArgLowerAt(0).equals("vehicle")) {
return false;
}
}
else if (cmd.equals("damages")) {
if (!couldMatchEntity(path.eventArgLowerAt(2))) {
return false;
}
if (path.eventArgLowerAt(2).equals("vehicle")) {
return false;
}
}
else {
return false;
}
if (!couldMatchEntity(path.eventArgLowerAt(0))) {
Expand Down

0 comments on commit cb809c7

Please sign in to comment.