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