Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Talamar1 committed Sep 5, 2015
1 parent 1285b3c commit 541cb71
Showing 1 changed file with 4 additions and 6 deletions.
Expand Up @@ -75,7 +75,8 @@ public boolean couldMatch(ScriptContainer scriptContainer, String s) {
public boolean matches(ScriptContainer scriptContainer, String s) {
String lower = CoreUtilities.toLowerCase(s);
String cmd = CoreUtilities.getXthArg(1, lower);
String pTest = cmd.equals("hits") ? CoreUtilities.getXthArg(0, lower) : CoreUtilities.getXthArg(4, lower);
String pTest = cmd.equals("hits") ? CoreUtilities.getXthArg(0, lower) :
CoreUtilities.getXthArg(3, lower).equals("with") ? CoreUtilities.getXthArg(4, lower) : "";

if (pTest.length() > 0 && !projectile.matchesEntity(pTest)) {
return false;
Expand All @@ -91,13 +92,10 @@ public boolean matches(ScriptContainer scriptContainer, String s) {
return false;
}

if (!runInCheck(scriptContainer, s, lower, location)) {
return false;
}

return true;
return runInCheck(scriptContainer, s, lower, location);
}


@Override
public String getName() {
return "ProjectileHits";
Expand Down

0 comments on commit 541cb71

Please sign in to comment.