mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
EffectManager: remove redundant check (#5153)
This commit is contained in:
parent
75d7adfb2d
commit
705df7d508
@ -85,14 +85,11 @@ class EffectManager{
|
|||||||
$index = spl_object_id($effectType);
|
$index = spl_object_id($effectType);
|
||||||
if(isset($this->effects[$index])){
|
if(isset($this->effects[$index])){
|
||||||
$effect = $this->effects[$index];
|
$effect = $this->effects[$index];
|
||||||
$hasExpired = $effect->hasExpired();
|
|
||||||
$ev = new EntityEffectRemoveEvent($this->entity, $effect);
|
$ev = new EntityEffectRemoveEvent($this->entity, $effect);
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
if($hasExpired && !$ev->getEffect()->hasExpired()){ //altered duration of an expired effect to make it not get removed
|
foreach($this->effectAddHooks as $hook){
|
||||||
foreach($this->effectAddHooks as $hook){
|
$hook($ev->getEffect(), true);
|
||||||
$hook($ev->getEffect(), true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user