From 7189be69b037a42a78ecd106dd9b70de028021d6 Mon Sep 17 00:00:00 2001 From: MEEPofFaith <54301439+MEEPofFaith@users.noreply.github.com> Date: Mon, 12 Sep 2022 06:41:43 -0700 Subject: [PATCH] `killShooter` + `shootOnDeath` Causes Double Firing (#7524) * Store building pos instead of start pos Fix an explosion hitting the same building multiple times if it's larger than 1x1. * Increment total shots before spawning bullet Fixes `killShooter` triggering the `shootOnDeath` shot. * Revert "Store building pos instead of start pos" This reverts commit bfd04e26837a5d91ef4b432f4f83f25d72b566de. --- core/src/mindustry/type/Weapon.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/type/Weapon.java b/core/src/mindustry/type/Weapon.java index 22275a6c6c..0edd2387d0 100644 --- a/core/src/mindustry/type/Weapon.java +++ b/core/src/mindustry/type/Weapon.java @@ -408,12 +408,12 @@ public class Weapon implements Cloneable{ } shoot.shoot(mount.totalShots, (xOffset, yOffset, angle, delay, mover) -> { + mount.totalShots++; if(delay > 0f){ Time.run(delay, () -> bullet(unit, mount, xOffset, yOffset, angle, mover)); }else{ bullet(unit, mount, xOffset, yOffset, angle, mover); } - mount.totalShots++; }); }