Skip to content

Commit

Permalink
Remove check for sink before collision explosion
Browse files Browse the repository at this point in the history
This feature should be in Movecraft itself
  • Loading branch information
TylerS1066 committed Jul 28, 2024
1 parent ec44253 commit 0fca33f
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,9 @@ public class CraftCollisionExplosionListener implements Listener {
public void collisionExplosionListener(@NotNull CraftCollisionExplosionEvent e) {
if (!DamageTracking.EnableTorpedoTracking)
return;
if (!(e.getCraft() instanceof PilotedCraft))
if (!(e.getCraft() instanceof PilotedCraft damaging))
return;

PilotedCraft damaging = (PilotedCraft) e.getCraft();

//check if the craft should sink
CraftStatus status = Movecraft.getInstance().getAsyncManager().checkCraftStatus(e.getCraft());
if (status.isSinking()) {
e.setCancelled(true);
CraftManager.getInstance().sink(e.getCraft());
}

PlayerCraft damaged = fastNearestPlayerCraftToCraft(damaging);
if (damaged == null)
return;
Expand Down

0 comments on commit 0fca33f

Please sign in to comment.