v2.0.0: fixed challenge having no text if targeting an empty space

This commit is contained in:
Evan Debenham
2023-02-27 18:41:40 -05:00
parent 76cddd5ac7
commit 83a017409e
@@ -81,19 +81,21 @@ public class Challenge extends ArmorAbility {
@Override @Override
protected void activate(ClassArmor armor, Hero hero, Integer target) { protected void activate(ClassArmor armor, Hero hero, Integer target) {
if (target == null || !Dungeon.level.heroFOV[target]){ if (target == null){
return; return;
} }
Char targetCh = Actor.findChar(target); Char targetCh = Actor.findChar(target);
if (targetCh == null || !Dungeon.level.heroFOV[target]){
GLog.w(Messages.get(this, "no_target"));
return;
}
if (hero.buff(DuelParticipant.class) != null){ if (hero.buff(DuelParticipant.class) != null){
GLog.w(Messages.get(this, "already_dueling")); GLog.w(Messages.get(this, "already_dueling"));
return; return;
} }
if (targetCh != null){
if (targetCh.alignment == hero.alignment){ if (targetCh.alignment == hero.alignment){
GLog.w(Messages.get(this, "ally_target")); GLog.w(Messages.get(this, "ally_target"));
return; return;
@@ -180,7 +182,6 @@ public class Challenge extends ArmorAbility {
hero.buff(EliminationMatchTracker.class).detach(); hero.buff(EliminationMatchTracker.class).detach();
} }
} }
}
@Override @Override
public Talent[] talents() { public Talent[] talents() {