mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-24 20:04:28 +00:00
Fixed crash on already dead players, closes #2856
This commit is contained in:
parent
3b6e10b759
commit
414549659a
@ -2592,7 +2592,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
$cause = $this->getLastDamageCause();
|
$cause = $this->getLastDamageCause();
|
||||||
|
|
||||||
switch($cause->getCause()){
|
switch($cause === null ? EntityDamageEvent::CAUSE_CUSTOM : $cause->getCause()){
|
||||||
case EntityDamageEvent::CAUSE_ENTITY_ATTACK:
|
case EntityDamageEvent::CAUSE_ENTITY_ATTACK:
|
||||||
if($cause instanceof EntityDamageByEntityEvent){
|
if($cause instanceof EntityDamageByEntityEvent){
|
||||||
$e = $cause->getDamager();
|
$e = $cause->getDamager();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user