Skip to content

Commit

Permalink
Merge pull request #6529 from Scoppio/fix/gamedataset-logger-narc
Browse files Browse the repository at this point in the history
fix: check if it is a narcpod before trying to access getPosition
  • Loading branch information
HammerGS authored Feb 11, 2025
2 parents 1d59a70 + 959f079 commit a4aff92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/GameDatasetLogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ private void append(Game game, AbstractAttackAction attackAction, boolean withHe
if (target != null ) {
targetId = target.getId() + "";
targetType = target.getClass().getSimpleName();
targetCoords = target.getPosition() != null ? target.getPosition().toTSV() : "-1\t-1";
targetCoords = !(target instanceof INarcPod) && target.getPosition() != null ? target.getPosition().toTSV() : "-1\t-1";
if (target instanceof Entity entity) {
targetPlayerId = entity.getOwner().getId() + "";
targetRole = entity.getRole() == null ? UnitRole.NONE.name() : entity.getRole().name();
Expand Down

0 comments on commit a4aff92

Please sign in to comment.