diff --git a/src/engine/net/client/handlers/TrackWindowMsgHandler.java b/src/engine/net/client/handlers/TrackWindowMsgHandler.java index 7886a7b1..18866eb2 100644 --- a/src/engine/net/client/handlers/TrackWindowMsgHandler.java +++ b/src/engine/net/client/handlers/TrackWindowMsgHandler.java @@ -86,15 +86,15 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler { if (ablist == null) return true; - TrackPowerAction tpa = null; + TrackPowerAction trackPowerAction = null; for (ActionsBase ab : ablist) { AbstractPowerAction apa = ab.getPowerAction(); if (apa != null && apa instanceof TrackPowerAction) - tpa = (TrackPowerAction) apa; + trackPowerAction = (TrackPowerAction) apa; } - if (tpa == null) + if (trackPowerAction == null) return true; // Check powers for normal users @@ -111,16 +111,16 @@ public class TrackWindowMsgHandler extends AbstractClientMsgHandler { int mask = 0; if (pb.targetPlayer()) - if (tpa.trackVampire()) // track vampires + if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Vampire)) // track vampires mask = MBServerStatics.MASK_PLAYER | MBServerStatics.MASK_UNDEAD; else // track all players mask = MBServerStatics.MASK_PLAYER; else if (pb.targetCorpse()) // track corpses mask = MBServerStatics.MASK_CORPSE; - else if (tpa.trackNPC()) // Track NPCs + else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.NPC)) // Track NPCs mask = MBServerStatics.MASK_NPC; - else if (tpa.trackUndead()) // Track Undead + else if (trackPowerAction.powerAction.trackEntry.filter.equals(mbEnums.MonsterType.Undead)) // Track Undead mask = MBServerStatics.MASK_MOB | MBServerStatics.MASK_UNDEAD; else // Track All diff --git a/src/engine/powers/poweractions/TrackPowerAction.java b/src/engine/powers/poweractions/TrackPowerAction.java index e2f8e66b..15585359 100644 --- a/src/engine/powers/poweractions/TrackPowerAction.java +++ b/src/engine/powers/poweractions/TrackPowerAction.java @@ -25,63 +25,20 @@ import java.util.HashMap; public class TrackPowerAction extends AbstractPowerAction { private String effectID; - private boolean trackPlayer; - private boolean trackCorpse; - private boolean trackAll; - private boolean trackDragon; - private boolean trackGiant; - private boolean trackNPC; - private boolean trackUndead; - private boolean trackVampire; - private int maxTrack; private EffectsBase effect; + public PowerAction powerAction; public TrackPowerAction(PowerAction powerAction, HashMap effects) { super(powerAction); this.effectID = powerAction.effects.get(0).effect_id; this.effect = effects.get(this.effectID); + this.powerAction = powerAction; } public String getEffectID() { return this.effectID; } - public boolean trackPlayer() { - return this.trackPlayer; - } - - public boolean trackCorpse() { - return this.trackCorpse; - } - - public boolean trackAll() { - return this.trackAll; - } - - public boolean trackDragon() { - return this.trackDragon; - } - - public boolean trackGiant() { - return this.trackGiant; - } - - public boolean trackNPC() { - return this.trackNPC; - } - - public boolean trackUndead() { - return this.trackUndead; - } - - public boolean trackVampire() { - return this.trackVampire; - } - - public int getMaxTrack() { - return this.maxTrack; - } - public EffectsBase getEffect() { return this.effect; }