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

[0.45.4] Artillery attack on APC with 2 infantry units stops phase from ending #1407

Closed
Da-Nuker opened this issue Jul 7, 2019 · 2 comments

Comments

@Da-Nuker
Copy link

Da-Nuker commented Jul 7, 2019

Megamek 0.45.4 as part of MekHQ
Win Java 1.8.0_211 64-bit

Launching an artillery weapon (tested Arrow IV artillery missile) onto an APC carrying two units of Battle Armor (tested Badger (C) Prime, and two Elemental Points) causes Megamek to freeze at end of firing phase.

The game does not freeze if it was there was only a single unit of BA carried.

This error message log was found in megameklog:
Exception in thread "Packet Pump" java.lang.ArrayIndexOutOfBoundsException: 6
at megamek.common.Entity.getInternalForReal(Entity.java:3146)
at megamek.common.Entity.getInternal(Entity.java:3139)
at megamek.common.Infantry.getInternal(Infantry.java:732)
at megamek.common.BattleArmor.getInternal(BattleArmor.java:783)
at megamek.common.BattleArmor.getTrooperAtLocation(BattleArmor.java:705)
at megamek.server.Server.damageExternalPassenger(Server.java:24894)
at megamek.server.Server.damageEntity(Server.java:23675)
at megamek.server.Server.damageEntity(Server.java:23018)
at megamek.server.Server.artilleryDamageHex(Server.java:36732)
at megamek.server.Server.artilleryDamageArea(Server.java:36843)
at megamek.server.Server.artilleryDamageArea(Server.java:36804)
at megamek.common.weapons.ArtilleryWeaponIndirectFireHandler.handle(ArtilleryWeaponIndirectFireHandler.java:452)
at megamek.server.Server.handleAttacks(Server.java:37078)
at megamek.server.Server.handleAttacks(Server.java:37007)
at megamek.server.Server.endCurrentPhase(Server.java:3136)
at megamek.server.Server.changeToNextTurn(Server.java:3473)
at megamek.server.Server.endCurrentTurn(Server.java:2463)
at megamek.server.Server.receiveAttack(Server.java:14058)
at megamek.server.Server.handle(Server.java:32801)
at megamek.server.Server$PacketPump.run(Server.java:369)

Files

Load the save game as player "Naga" and with target player "BA".
As Naga, Launch Arrow IV in direct fire mode at the surviving Badger (C) hex.

autosave.sav.gz

@Da-Nuker Da-Nuker changed the title [0.45.4] [0.45.4] Artillery attack on APC with 2 infantry units stops phase from processing Jul 7, 2019
@Da-Nuker Da-Nuker changed the title [0.45.4] Artillery attack on APC with 2 infantry units stops phase from processing [0.45.4] Artillery attack on APC with 2 infantry units stops phase from ending Jul 7, 2019
@mkerensky
Copy link
Collaborator

Looks like this doesn't actually have much if anything to do with artillery attacks. It's a case of random damage assignment to your battle armor passengers looking for nonexistant Trooper 6. I haven't tested it, but this will probably also happen if you have an IS squad and rear transport damage tries to find Trooper 5.

@mkerensky
Copy link
Collaborator

I added a couple of checks to make sure the array of existing battle armor troopers is large enough to have data for a 5th and 6th trooper before trying to damage them. Seems to have resolved the issue.

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

No branches or pull requests

2 participants