Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FireControl Error "FireControl.entityCanIndirectFireMissile" #5720

Closed
repligator opened this issue Jul 10, 2024 · 2 comments · Fixed by #5774
Closed

FireControl Error "FireControl.entityCanIndirectFireMissile" #5720

repligator opened this issue Jul 10, 2024 · 2 comments · Fixed by #5774
Assignees
Labels

Comments

@repligator
Copy link
Collaborator

Environment

Developmental
Linux
Java 17

Description

While testing the new heatmaps, a (quite possibly unrelated) error appears frequently in the logs.

11:33:16,191 ERROR [megamek.client.bot.princess.FireControl] {Red Princess Turn 0 Calc Thread} megamek.client.bot.princess.FireControl.entityCanIndirectFireMissile(FireControl.java:2434) - null java.util.ConcurrentModificationException at java.base/java.util.Vector$Itr.checkForComodification(Vector.java:1298) at java.base/java.util.Vector$Itr.next(Vector.java:1254) at megamek.common.EquipmentType.hasModeType(EquipmentType.java:556) at megamek.common.Mounted.hasModeType(Mounted.java:240) at megamek.client.bot.princess.FireControl.entityCanIndirectFireMissile(FireControl.java:2426) at megamek.client.bot.princess.Princess.initFiringEntities(Princess.java:1801) at megamek.client.bot.princess.Princess.getEntityToFire(Princess.java:1773) at megamek.client.bot.princess.Princess.calculateFiringTurn(Princess.java:639) at megamek.client.bot.BotClient.calculateMyTurnWorker(BotClient.java:529) at megamek.client.bot.BotClient.calculateMyTurn(BotClient.java:487) at megamek.client.bot.BotClient$CalculateBotTurn.run(BotClient.java:65) at java.base/java.lang.Thread.run(Thread.java:840)

Files

megamek.log
Round-9-autosave_2024-07-10_11-44-20.sav.gz
Round-10-autosave_2024-07-10_11-46-36.sav.gz

@Sleet01
Copy link
Collaborator

Sleet01 commented Jul 18, 2024

This is most likely caused by modifying a dataset containing Mounted or EquipmentType instances while traversing the same dataset.
The entityCanIndirectFireMissile() call just happens to be where we hit this, and is not directly connected.

@Sleet01 Sleet01 self-assigned this Jul 22, 2024
@Sleet01
Copy link
Collaborator

Sleet01 commented Jul 23, 2024

LOL. I'd spotted this about 5 months back, added some comment to be aware of the issue, and then forgotten -_-;.
Simplest solution is just to use an explicit iterator loop when checking if any weapons have the Indirect mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants