mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-01 07:39:57 +00:00
Living: Reset attack cooldown before applying post damage effects
this fixes things causing damage during post-damage calls coming back and being able to do even more damage
This commit is contained in:
parent
6c6630d845
commit
484d34fe04
@ -535,6 +535,8 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$this->attackTime = 10; //0.5 seconds cooldown
|
||||||
|
|
||||||
if($source instanceof EntityDamageByEntityEvent){
|
if($source instanceof EntityDamageByEntityEvent){
|
||||||
$e = $source->getDamager();
|
$e = $source->getDamager();
|
||||||
if($source instanceof EntityDamageByChildEntityEvent){
|
if($source instanceof EntityDamageByChildEntityEvent){
|
||||||
@ -552,15 +554,12 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($this->isAlive()){
|
if($this->isAlive()){
|
||||||
$this->applyPostDamageEffects($source);
|
$this->applyPostDamageEffects($source);
|
||||||
$this->doHitAnimation();
|
$this->doHitAnimation();
|
||||||
}else{
|
}else{
|
||||||
$this->startDeathAnimation();
|
$this->startDeathAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->attackTime = 10; //0.5 seconds cooldown
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function doHitAnimation() : void{
|
protected function doHitAnimation() : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user