Bug Fix: Players not in a party would cause a null pointer exception during a pvp kill.

This commit is contained in:
nossr50 2011-02-04 20:58:21 -08:00
parent 18bc3fec4a
commit 6feb824940

View File

@ -25,9 +25,9 @@ public class mcEntityListener extends EntityListener {
//If defender is player //If defender is player
if(x instanceof Player){ if(x instanceof Player){
Player defender = (Player)x; Player defender = (Player)x;
if(mcUsers.getProfile(defender).getParty().equals(mcUsers.getProfile(attacker).getParty())){ if(mcUsers.getProfile(defender).inParty() && mcUsers.getProfile(defender).getParty().equals(mcUsers.getProfile(attacker).getParty()))
event.setCancelled(true); event.setCancelled(true);
}
if(mcUsers.getProfile(defender).isDead()) if(mcUsers.getProfile(defender).isDead())
return; return;
if((defender.getHealth() - event.getDamage()) <= 0){ if((defender.getHealth() - event.getDamage()) <= 0){