mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +00:00
Projectile: allow using negative damage amounts to remove damage effects
This commit is contained in:
parent
a8a3eb3866
commit
cdd3fe81e1
@ -284,6 +284,7 @@ abstract class Projectile extends Entity{
|
|||||||
protected function onHitEntity(Entity $entityHit, RayTraceResult $hitResult) : void{
|
protected function onHitEntity(Entity $entityHit, RayTraceResult $hitResult) : void{
|
||||||
$damage = $this->getResultDamage();
|
$damage = $this->getResultDamage();
|
||||||
|
|
||||||
|
if($damage >= 0){
|
||||||
if($this->getOwningEntity() === null){
|
if($this->getOwningEntity() === null){
|
||||||
$ev = new EntityDamageByEntityEvent($this, $entityHit, EntityDamageEvent::CAUSE_PROJECTILE, $damage);
|
$ev = new EntityDamageByEntityEvent($this, $entityHit, EntityDamageEvent::CAUSE_PROJECTILE, $damage);
|
||||||
}else{
|
}else{
|
||||||
@ -299,6 +300,7 @@ abstract class Projectile extends Entity{
|
|||||||
$entityHit->setOnFire($ev->getDuration());
|
$entityHit->setOnFire($ev->getDuration());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->flagForDespawn();
|
$this->flagForDespawn();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user