From 7e5bd645023c439d806438d51653f74f1c11b686 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 26 May 2022 11:57:12 -0400 Subject: [PATCH] 1.5.0 Release Canidate 4.2c --- .../hideAndSeek/game/listener/DamageHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java index 7f0e4d5..19ec83a 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/listener/DamageHandler.java @@ -61,9 +61,11 @@ public class DamageHandler implements Listener { event.setCancelled(true); return; } + // If there was no attacker, if the damaged is not a player, ignore them. + } else if (!board.contains(player)) { + return; // If there is no attacker, it most of been by natural causes. If pvp is disabled, and config doesn't allow natural causes, cancel event. - // Also, if there was no attacker, if the damaged is not a player, ignore them. - } else if (!board.contains(player) || !pvpEnabled && !allowNaturalCauses && board.contains(player)) { + } else if (!pvpEnabled && !allowNaturalCauses && board.contains(player)) { event.setCancelled(true); return; }