diff --git a/src/main/java/fr/leomelki/loupgarou/roles/RCupidon.java b/src/main/java/fr/leomelki/loupgarou/roles/RCupidon.java index 1d559e2..320b800 100644 --- a/src/main/java/fr/leomelki/loupgarou/roles/RCupidon.java +++ b/src/main/java/fr/leomelki/loupgarou/roles/RCupidon.java @@ -255,9 +255,12 @@ public class RCupidon extends Role{ public void onChat(AsyncPlayerChatEvent e) { LGPlayer player = LGPlayer.thePlayer(e.getPlayer()); if(player.getGame() == getGame()) { - if(e.getMessage().startsWith("!") && player.getCache().has("inlove")) { - player.sendMessage("§d\u2764 "+player.getName()+" §6» §f"+e.getMessage().substring(1)); - player.getCache().get("inlove").sendMessage("§d\u2764 "+player.getName()+" §6» §f"+e.getMessage().substring(1)); + if(e.getMessage().startsWith("!")) { + if(player.getCache().has("inlove")){ + player.sendMessage("§d\u2764 "+player.getName()+" §6» §f"+e.getMessage().substring(1)); + player.getCache().get("inlove").sendMessage("§d\u2764 "+player.getName()+" §6» §f"+e.getMessage().substring(1)); + }else + player.sendMessage("§4Erreur : §cVous n'êtes pas en couple !"); e.setCancelled(true); } }