GAIGResearch / Tribes

Tribes is an open source implementation for AI research of the game The Battle of Polytopia
60 stars 13 forks source link

SimpleAgent crash #301

Closed GAIGResearch closed 4 years ago

GAIGResearch commented 4 years ago

Happened here:

Exception in thread "main" java.lang.NullPointerException at players.SimpleAgent.evalHeal(SimpleAgent.java:470) at players.SimpleAgent.evalAction(SimpleAgent.java:104) at players.SimpleAgent.act(SimpleAgent.java:58) at core.game.Game.processTurn(Game.java:303) at core.game.Game.tick(Game.java:223) at core.game.Game.run(Game.java:201) at Run.runGame(Run.java:37) at Play.run(Play.java:101) at Play.main(Play.java:54)

It is in this line:

if (target.getCurrentHP() < target.getMaxHP()) {

so it's possible that "target" is null. It also happens here (probably because "enemy" is also null):

Exception in thread "main" java.lang.NullPointerException at players.SimpleAgent.evalHeal(SimpleAgent.java:474) at players.SimpleAgent.evalAction(SimpleAgent.java:104) at players.SimpleAgent.act(SimpleAgent.java:58) at core.game.Game.processTurn(Game.java:303) at core.game.Game.tick(Game.java:223) at core.game.Game.run(Game.java:201) at Run.runGame(Run.java:37) at Play.run(Play.java:101) at Play.main(Play.java:54)