MegaMek / megamek

MegaMek is a networked Java clone of BattleTech, a turn-based sci-fi boardgame for 2+ players. Fight using giant robots, tanks, and/or infantry on a hex-based map.
http://www.megamek.org
GNU General Public License v2.0
288 stars 277 forks source link

RFE: Implement chaff pods #4384

Open Saklad5 opened 1 year ago

Saklad5 commented 1 year ago

Chaff pods are currently in MegaMek, but are not functional.

The rules may be found on page 111 of Tactical Operations: Advanced Units & Equipment, and consist of a few distinct effects that occur at the end of the movement phase:

These effects are all removed during the end phase of the same round, and do not work without an atmosphere (not in space, not in vacuum).

Even a partial implementation would still be an improvement.

Saklad5 commented 1 year ago

@Lu9us This appears broken in the 0.49.13 snapshot, seemingly due to the ECM's lack of affiliation.

07:04:08,587 ERROR [megamek.client.Client] {AWT-EventQueue-0}
megamek.client.Client.handlePacket(Client.java:1666) - Failed to parse Packet command ENTITY_UPDATE
java.lang.NullPointerException: Cannot invoke "megamek.common.Player.isEnemyOf(megamek.common.Player)" because "this.owner" is null
    at megamek.common.ECMInfo.addAlliedECMEffects(ECMInfo.java:343)
    at megamek.client.ui.swing.boardview.ECMEffects.getHexColor(ECMEffects.java:96)
    at megamek.client.ui.swing.boardview.BoardView.processAffectedCoords(BoardView.java:5344)
    at megamek.client.ui.swing.boardview.BoardView.updateEcmList(BoardView.java:5306)
    at megamek.client.ui.swing.boardview.BoardView$10.gameEntityChange(BoardView.java:4965)
    at megamek.common.event.GameEntityChangeEvent.fireEvent(GameEntityChangeEvent.java:106)
    at megamek.common.Game.processGameEvent(Game.java:2985)
    at megamek.common.Game.setEntity(Game.java:1274)
    at megamek.client.Client.receiveEntityUpdate(Client.java:1049)
    at megamek.client.Client.handlePacket(Client.java:1422)
    at megamek.client.Client$1.lambda$packetReceived$0(Client.java:174)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
    at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
    at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
    at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
    at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Lu9us commented 1 year ago

Hey do you have some steps for reproduction or is this happening all the time ?

I didn't see this happening when I was doing dev but I'm happy to take a look tomorrow and see if I can reproduce it.

Saklad5 commented 1 year ago

Hey do you have some steps for reproduction or is this happening all the time ?

I didn't see this happening when I was doing dev but I'm happy to take a look tomorrow and see if I can reproduce it.

I think it was introduced when merged, due to changes to how ECM is displayed.

Lu9us commented 1 year ago

Cool I'll take a look and see if I can implement a fix

Lu9us commented 1 year ago

Still working on this but the fix wasn't as simple as hoped + work and travel have left little time to look at it.