Skip to content

Commit c8c97ab

Browse files
Fix transportship target tile on construction (#2896)
## Description: The recent pathfinding rework broke the naval invasion target. This change reverts the code to the previous working one. <img width="232" height="273" alt="image" src="https://github.com/user-attachments/assets/0cc3ed80-bd77-4e7b-886b-0ce5012840ac" /> ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: IngloriousTom
1 parent a28a7ef commit c8c97ab

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/core/execution/TransportShipExecution.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,14 +143,9 @@ export class TransportShipExecution implements Execution {
143143

144144
this.boat = this.attacker.buildUnit(UnitType.TransportShip, this.src, {
145145
troops: this.startTroops,
146+
targetTile: this.dst ?? undefined,
146147
});
147148

148-
if (this.dst !== null) {
149-
this.boat.setTargetTile(this.dst);
150-
} else {
151-
this.boat.setTargetTile(undefined);
152-
}
153-
154149
// Notify the target player about the incoming naval invasion
155150
if (this.targetID && this.targetID !== mg.terraNullius().id()) {
156151
mg.displayIncomingUnit(

0 commit comments

Comments
 (0)