mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 06:25:32 +00:00
fixed negative effect durations when level tick rate is > 1
thank you @Sandertv
This commit is contained in:
parent
b7cd8dbfa9
commit
3614711a02
@ -463,9 +463,12 @@ abstract class Living extends Entity implements Damageable{
|
|||||||
if($effect->canTick()){
|
if($effect->canTick()){
|
||||||
$effect->applyEffect($this);
|
$effect->applyEffect($this);
|
||||||
}
|
}
|
||||||
$effect->setDuration($effect->getDuration() - $tickDiff);
|
|
||||||
if($effect->getDuration() <= 0){
|
$duration = $effect->getDuration() - $tickDiff;
|
||||||
|
if($duration <= 0){
|
||||||
$this->removeEffect($effect->getId());
|
$this->removeEffect($effect->getId());
|
||||||
|
}else{
|
||||||
|
$effect->setDuration($duration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user