From a640398915127241357cc3b85628f54b1246fbf8 Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Wed, 19 Feb 2025 18:09:57 +0000 Subject: [PATCH] Fix 11a8b71: Set direction and rotation of ships upon building --- src/ship_cmd.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ship_cmd.cpp b/src/ship_cmd.cpp index 9c11b377d4..427374020f 100644 --- a/src/ship_cmd.cpp +++ b/src/ship_cmd.cpp @@ -912,7 +912,12 @@ CommandCost CmdBuildShip(DoCommandFlags flags, TileIndex tile, const Engine *e, v->y_pos = y; v->z_pos = GetSlopePixelZ(x, y); + v->direction = DiagDirToDir(GetShipDepotDirection(tile)); + + /* UpdateDeltaXY() requires rotation to be initialised as well. */ + v->rotation = v->direction; v->UpdateDeltaXY(); + v->vehstatus = VS_HIDDEN | VS_STOPPED | VS_DEFPAL; v->spritenum = svi->image_index;