fix(combat): players are getting kicked when attacking dead entities (#271)

* fix(combat): kick players attacking dead players (health <= 0.0)
This commit is contained in:
DataModel
2024-11-14 12:38:32 -06:00
committed by GitHub
parent 1ae9c99b2d
commit 91d2eeebb7

View File

@@ -454,7 +454,11 @@ impl Player {
.await;
return;
};
if victim.living_entity.health.load() <= 0.0 {
// you can trigger this from a non-modded / innocent client client,
// so we shouldn't kick the player
return;
}
self.attack(&victim).await;
}
ActionType::Interact | ActionType::InteractAt => {