[AI] refactor

This commit is contained in:
RedSparr0w 2019-09-26 18:56:46 +12:00
parent 3336f3422e
commit 686757d189
4 changed files with 4 additions and 10 deletions

View file

@ -181,8 +181,6 @@ public class AIPlayer extends Player {
{
int meX = this.getLocation().getX();
int meY = this.getLocation().getY();
//int meX2 = this.getLocation().getX();
//System.out.println("local " + meX + " real x? " + meX2 );
ArrayList<Node> nodes = new ArrayList<Node>();
for (NPC npc : RegionManager.getLocalNpcs(this, range)) {
if (npc.getId() == entry)
@ -399,14 +397,12 @@ public class AIPlayer extends Player {
* @param uid The player's UID.
*/
public static void deregister(int uid) {
if (!botMapping.containsKey(uid)) {
System.err.println("Could not deregister AIP#" + uid + ": UID not added to the mapping!");
return;
}
AIPlayer player = botMapping.get(uid);
if (player != null) {
player.clear();
return;
}
System.err.println("Could not deregister AIP#" + uid + ": UID not added to the mapping!");
}
@Override

View file

@ -13,8 +13,7 @@ public class LowestBot extends PvMBots{
private int tick = 0;
@Override
public void tick()
{
public void tick(){
super.tick();
//Despawn

View file

@ -74,8 +74,8 @@ public class PvMBots extends AIPlayer {
if (creatures == null) {
return false;
}
if (!(creatures.isEmpty())) {
bot.attack(creatures.get(RandomFunction.getRandom((creatures.size() - 1))));
if (!creatures.isEmpty()) {
return true;
} else {
creatures = FindTargets(bot, radius);

View file

@ -189,7 +189,6 @@ public final class AIPCommandPlugin extends CommandPlugin {
PVPAIPActions.syncBotThread(player);
return true;
case "bot":
PvMBotsBuilder.spawnLowest(player.getLocation());
return true;