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 bfd04e2683.
This commit is contained in:
MEEPofFaith 2022-09-12 06:41:43 -07:00 committed by GitHub
parent 82058d347f
commit 7189be69b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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++;
});
}