From 1f83ea41fcedf8ecf5fe4d232b78b56f51f5d362 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Wed, 16 Apr 2025 22:27:36 +0100 Subject: [PATCH] Fix: [NewGRF] PrepareLayout worked on a copy of the data resulting in bad sprite layouts. (#14013) --- src/newgrf_commons.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp index a46b5477d6..3d28b360ad 100644 --- a/src/newgrf_commons.cpp +++ b/src/newgrf_commons.cpp @@ -617,7 +617,7 @@ uint32_t NewGRFSpriteLayout::PrepareLayout(uint32_t orig_offset, uint32_t newgrf * and apply the default sprite offsets (unless disabled). */ const TileLayoutRegisters *regs = this->registers.empty() ? nullptr : this->registers.data(); bool ground = true; - for (DrawTileSeqStruct result : result_seq) { + for (DrawTileSeqStruct &result : result_seq) { TileLayoutFlags flags = TLF_NOTHING; if (regs != nullptr) flags = regs->flags;