From 718a45b8455c3f4636534e3da3db666a5db5beb5 Mon Sep 17 00:00:00 2001 From: SamuXarick <43006711+SamuXarick@users.noreply.github.com> Date: Sat, 22 Feb 2025 23:33:25 +0000 Subject: [PATCH] Fix 11a8b71: Set direction and rotation of ships upon building (#13625) --- 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;