triplea icon indicating copy to clipboard operation
triplea copied to clipboard

GameMap#getNeighbors:102 - java.lang.IllegalArgumentException

Open tripleabuilderbot opened this issue 1 year ago • 4 comments

User Description

Was in between human turns during Zombie research phase, it keeps popping an exception that null has no neighbor

Map

Zombies-World_War_2 / Zombies-World_War_2

Log Message

No neighbors for: null

TripleA Version

2.7.14834

Java Version

11.0.19

Operating System

Windows 11

Heap Size

8152M

Stack Trace

Exception: java.lang.IllegalArgumentException No neighbors for: null
java.lang.Exception
	at games.strategy.engine.data.GameMap.getNeighbors(GameMap.java:102)
	at games.strategy.engine.data.GameMap.getNeighbors(GameMap.java:119)
	at games.strategy.engine.data.GameMap.getNeighbors(GameMap.java:113)
	at games.strategy.triplea.ai.pro.ProTechAi.findFrontier(ProTechAi.java:617)
	at games.strategy.triplea.ai.pro.ProTechAi.getExactNeighbors(ProTechAi.java:600)
	at games.strategy.triplea.ai.pro.ProTechAi.getNeighboringLandTerritories(ProTechAi.java:579)
	at games.strategy.triplea.ai.pro.ProTechAi.tech(ProTechAi.java:50)
	at games.strategy.triplea.ai.pro.AbstractProAi.tech(AbstractProAi.java:308)
	at games.strategy.triplea.ai.AbstractAi.start(AbstractAi.java:512)
	at games.strategy.engine.framework.ServerGame.waitForPlayerToFinishStep(ServerGame.java:611)
	at games.strategy.engine.framework.ServerGame.runStep(ServerGame.java:460)
	at games.strategy.engine.framework.ServerGame.runNextStep(ServerGame.java:347)
	at games.strategy.engine.framework.ServerGame.startGame(ServerGame.java:314)
	at games.strategy.engine.framework.startup.launcher.LocalLauncher.launchInternal(LocalLauncher.java:92)
	at games.strategy.engine.framework.startup.launcher.LocalLauncher.lambda$launch$0(LocalLauncher.java:60)
	at java.base/java.lang.Thread.run(Thread.java:829)


tripleabuilderbot avatar Aug 06 '24 15:08 tripleabuilderbot

Not sure I was logged in when I opened this

EduardoPantalones avatar Aug 06 '24 15:08 EduardoPantalones

@EduardoPantalones

Do you know if it does it with the 2.5 stable and if not, maybe check the last 2.6 prrelease and see it it happens there ?

beelee1 avatar Aug 06 '24 19:08 beelee1

@EduardoPantalones

Do you know if it does it with the 2.5 stable and if not, maybe check the last 2.6 prrelease and see it it happens there ?

I do not, if it happens again I will look at that for you. The workaround was to save, make Zombies Human and reload, and then switch them back to AI after their turn, we are 3 turns past event now. weird scenario :) Thanks for quick response!

EduardoPantalones avatar Aug 07 '24 12:08 EduardoPantalones

Should be fixed with PR 12831 (Fix issue 12822 GameMap#getNeighbors IllegalArgumentException). @EduardoPantalones Please confirm that on the map the issue is no longer experienced. Only hint I have is that it seemed to have been cause for cases where no "capitol" territory was passed on the search for neighbors. Not sure how exactly the setup had been or how to retest it.

frigoref avatar Aug 11 '24 14:08 frigoref