mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 04:15:04 +00:00
fixed negative effect durations when level tick rate is > 1
thank you @Sandertv
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user