Deselect spell if one is selected

This commit is contained in:
Yuri Moens 2021-10-20 20:24:33 +02:00
parent 9dea119a7d
commit 1523cb0289
Signed by: ymo
GPG Key ID: F6D51D6FE15BE924

View File

@ -5,6 +5,7 @@ import io.reisub.dreambot.util.Constants;
import io.reisub.dreambot.util.TaskNodeParent; import io.reisub.dreambot.util.TaskNodeParent;
import org.dreambot.api.methods.container.impl.Inventory; import org.dreambot.api.methods.container.impl.Inventory;
import org.dreambot.api.methods.filter.Filter; import org.dreambot.api.methods.filter.Filter;
import org.dreambot.api.methods.magic.Magic;
import org.dreambot.api.script.ScriptManager; import org.dreambot.api.script.ScriptManager;
import org.dreambot.api.script.listener.ChatListener; import org.dreambot.api.script.listener.ChatListener;
import org.dreambot.api.wrappers.interactive.NPC; import org.dreambot.api.wrappers.interactive.NPC;
@ -81,6 +82,15 @@ public class KittenTask extends TaskNodeParent {
}); });
} }
@Override
public int execute() {
if (Magic.isSpellSelected()) {
Magic.deselect();
}
return super.execute();
}
public void setHungry(boolean hungry) { public void setHungry(boolean hungry) {
this.hungry = hungry; this.hungry = hungry;
} }