Fix games not marked as started

This commit is contained in:
Daniel Saukel 2016-08-24 16:17:28 +02:00
parent ff7e8dbf5f
commit cf557a61e2
2 changed files with 39 additions and 33 deletions

View File

@ -170,7 +170,10 @@ public class EntityListener implements Listener {
DGroup attackerDGroup = null;
DGroup attackedDGroup = null;
if (attackerEntity instanceof LivingEntity && attackedEntity instanceof LivingEntity) {
if (!(attackerEntity instanceof LivingEntity) || !(attackedEntity instanceof LivingEntity)) {
return;
}
if (attackerEntity instanceof Player && attackedEntity instanceof Player) {
attackerPlayer = (Player) attackerEntity;
attackedPlayer = (Player) attackedEntity;
@ -180,11 +183,13 @@ public class EntityListener implements Listener {
if (!pvp) {
event.setCancelled(true);
return;
}
if (attackerDGroup != null && attackedDGroup != null) {
if (!friendlyFire && attackerDGroup.equals(attackedDGroup)) {
event.setCancelled(true);
return;
}
}
}
@ -216,7 +221,6 @@ public class EntityListener implements Listener {
}
}
}
}
// Deny food in Lobby
@EventHandler(priority = EventPriority.HIGH)

View File

@ -698,6 +698,8 @@ public class DGamePlayer extends DInstancePlayer {
respawn();
}
}
game.setStarted(true);
}
public void respawn() {