Skip to content

Commit

Permalink
Fix NotSerializableException introduced in 25b5433. (#12363)
Browse files Browse the repository at this point in the history
  • Loading branch information
asvitkine authored Feb 24, 2024
1 parent 5676b0f commit c1d0249
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -539,19 +539,13 @@ private void damagedChangeInto(

transformDamagedUnitsHistoryChange.perform(bridge);

cleanupKilledUnits(
bridge,
side,
transformDamagedUnitsHistoryChange.getOldUnits(),
transformDamagedUnitsHistoryChange.getNewUnits());
// Copy the unit lists to ensure they're serializable for the notification.
final var oldUnits = List.copyOf(transformDamagedUnitsHistoryChange.getOldUnits());
final var newUnits = List.copyOf(transformDamagedUnitsHistoryChange.getNewUnits());
cleanupKilledUnits(bridge, side, oldUnits, newUnits);
bridge
.getDisplayChannelBroadcaster()
.changedUnitsNotification(
battleId,
player,
transformDamagedUnitsHistoryChange.getOldUnits(),
transformDamagedUnitsHistoryChange.getNewUnits(),
null);
.changedUnitsNotification(battleId, player, oldUnits, newUnits, null);
}

@Override
Expand Down

0 comments on commit c1d0249

Please sign in to comment.