Skip to content

Commit

Permalink
Update EffPush.java
Browse files Browse the repository at this point in the history
  • Loading branch information
sovdeeth committed Nov 1, 2023
1 parent 9deb288 commit eb165ec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/ch/njol/skript/effects/EffPush.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ protected void execute(final Event e) {
final Vector mod = d.getDirection(en);
if (v != null)
mod.normalize().multiply(v.doubleValue());
if (!(Double.isFinite(mod.getX()) && Double.isFinite(mod.getY()) && Double.isFinite(mod.getZ()))) {
// Some component of the mod vector is not finite, so just stop
return;
}
en.setVelocity(en.getVelocity().add(mod)); // REMIND add NoCheatPlus exception to players
}
}
Expand Down

0 comments on commit eb165ec

Please sign in to comment.