mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Remove redundant count() for effects ticking
This commit is contained in:
@ -484,18 +484,16 @@ abstract class Living extends Entity implements Damageable{
|
||||
}
|
||||
|
||||
protected function doEffectsTick(int $tickDiff = 1){
|
||||
if(count($this->effects) > 0){
|
||||
foreach($this->effects as $effect){
|
||||
if($effect->canTick()){
|
||||
$effect->applyEffect($this);
|
||||
}
|
||||
foreach($this->effects as $effect){
|
||||
if($effect->canTick()){
|
||||
$effect->applyEffect($this);
|
||||
}
|
||||
|
||||
$duration = $effect->getDuration() - $tickDiff;
|
||||
if($duration <= 0){
|
||||
$this->removeEffect($effect->getId());
|
||||
}else{
|
||||
$effect->setDuration($duration);
|
||||
}
|
||||
$duration = $effect->getDuration() - $tickDiff;
|
||||
if($duration <= 0){
|
||||
$this->removeEffect($effect->getId());
|
||||
}else{
|
||||
$effect->setDuration($duration);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user