Open repligator opened 3 months ago
As of right now, destroyed buildings are handled thusly (see megamek/common/Board.java
):
// Handle garbage input.
if (bldg == null) {
LogManager.getLogger().error("Could not find a match for " + other + " to update.");
continue;
This writes X lines to the log, every turn, with X being the number of destroyed buildings. This can make logs difficult to read and may have a performance impact on maps with lot's of destroyed buildings (nukes, artillery, fire, etc.) Is it possible to recognize that a building has been destroyed and remove it from Vector so that this only runs once per each destroyed building per game?
Environment
Master (latest PR https://github.com/MegaMek/megamek/pull/5784) Linux Java 17
Description
Error appears after buildings are destroyed.
14:47:01,879 ERROR [megamek.common.Board] {AWT-EventQueue-0} megamek.common.Board.updateBuildings(Board.java:1466) - Could not find a match for Medium Building Building #70011 to update.
Files
megamek.log building_destroyed_error.sav.gz
(Different Game) building_to_update.megamek.log