From 60afd791dd09f26eb380bc4367546d8e5ae5aa68 Mon Sep 17 00:00:00 2001 From: henriquenakashima Date: Sat, 19 Sep 2020 16:59:48 -0400 Subject: [PATCH] Fix able to target illegal targets --- Assets/Battle/Targeting/SingleTargeting.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Assets/Battle/Targeting/SingleTargeting.cs b/Assets/Battle/Targeting/SingleTargeting.cs index 4cb29e4..0d871d2 100644 --- a/Assets/Battle/Targeting/SingleTargeting.cs +++ b/Assets/Battle/Targeting/SingleTargeting.cs @@ -22,8 +22,10 @@ public class SingleTargeting } } - public void NotifyParticipantSpriteClicked(BattleParticipant paticipant) { - this.participantClicked = paticipant; + public void NotifyParticipantSpriteClicked(BattleParticipant participant) { + if (CanTarget(participant)) { + this.participantClicked = participant; + } } public BattleParticipant GetTarget() {