Fix NPEs relating combat checks and world changing. Fixes #976, #979

This commit is contained in:
GJ
2013-04-22 23:19:26 -04:00
parent 7e67505dfb
commit 2ca7d139fe
3 changed files with 10 additions and 2 deletions

View File

@ -266,7 +266,7 @@ public final class CombatUtils {
if (target instanceof Player) {
Player player = (Player) target;
if (Misc.isNPCEntity(player)) {
if (Misc.isNPCEntity(player) || !player.isOnline()) {
return;
}
@ -291,6 +291,11 @@ public final class CombatUtils {
}
else if (attacker instanceof Player) {
Player player = (Player) attacker;
if (Misc.isNPCEntity(player)) {
return;
}
PlayerProfile profile = UserManager.getPlayer(player).getProfile();
if (Permissions.mobHealthDisplay(player) && profile.getMobHealthbarType() != MobHealthbarType.DISABLED) {