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:
@@ -408,12 +408,12 @@ public class Weapon implements Cloneable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
shoot.shoot(mount.totalShots, (xOffset, yOffset, angle, delay, mover) -> {
|
shoot.shoot(mount.totalShots, (xOffset, yOffset, angle, delay, mover) -> {
|
||||||
|
mount.totalShots++;
|
||||||
if(delay > 0f){
|
if(delay > 0f){
|
||||||
Time.run(delay, () -> bullet(unit, mount, xOffset, yOffset, angle, mover));
|
Time.run(delay, () -> bullet(unit, mount, xOffset, yOffset, angle, mover));
|
||||||
}else{
|
}else{
|
||||||
bullet(unit, mount, xOffset, yOffset, angle, mover);
|
bullet(unit, mount, xOffset, yOffset, angle, mover);
|
||||||
}
|
}
|
||||||
mount.totalShots++;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user