Fixed crash on already dead players, closes #2856

This commit is contained in:
Shoghi Cervantes 2015-04-11 15:13:27 +02:00
parent 3b6e10b759
commit 414549659a
No known key found for this signature in database
GPG Key ID: 78464DB0A7837F89

View File

@ -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();