End crystal: one blast call for both paths

The respawn check is read before the blast, so the two copies of the
explosion collapse into one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-25 17:37:51 +01:00
parent 8ffd595575
commit a495fcf7a7
+7 -15
View File
@@ -880,30 +880,22 @@ impl Game<'_> {
return;
}
let c = self.crystals.remove(index);
if self.fight.respawn.is_some()
// Read before the blast, which can take other respawn crystals.
let respawn_crystal = self.fight.respawn.is_some()
&& self
.fight
.respawn_crystals
.iter()
.any(|p| p.distance_squared(c.position) < 0.01)
{
if damage == CrystalDamage::Direct {
let at = [c.position.x, c.position.y, c.position.z];
let _ = self.server_explode(
at,
6.0,
super::explosion::BlockInteraction::Destroy,
false,
);
}
self.abort_respawn();
return;
}
.any(|p| p.distance_squared(c.position) < 0.01);
if damage == CrystalDamage::Direct {
let at = [c.position.x, c.position.y, c.position.z];
let _ =
self.server_explode(at, 6.0, super::explosion::BlockInteraction::Destroy, false);
}
if respawn_crystal {
self.abort_respawn();
return;
}
// EnderDragonFight.onCrystalDestroyed.
self.count_crystals();
if let Some(d) = self.dragon.as_mut() {