From c723a1a31422130e9c049f0e9a480b09b8da8cd9 Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 29 Jun 2020 23:13:23 +0100 Subject: [PATCH] Fix #12079: incorrect drawing of attached paint structs (#12082) * Fix #12079: incorrect drawing of attached paint structs The issue is caused by the paint_struct x and y coordinates being incorrectly marked as unsigned. Unfortunately they cannot easily be converted without careful rework. Therefore this is a stop gap until the type is changed to preferably a ScreenCoords. --- src/openrct2/paint/Paint.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index ee7ce56287..e9955f55b1 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -522,7 +522,8 @@ static void paint_attached_ps(rct_drawpixelinfo* dpi, paint_struct* ps, uint32_t attached_paint_struct* attached_ps = ps->attached_ps; for (; attached_ps; attached_ps = attached_ps->next) { - auto screenCoords = ScreenCoordsXY{ attached_ps->x + ps->x, attached_ps->y + ps->y }; + auto screenCoords = ScreenCoordsXY{ attached_ps->x + static_cast(ps->x), + attached_ps->y + static_cast(ps->y) }; uint32_t imageId = paint_ps_colourify_image(attached_ps->image_id, ps->sprite_type, viewFlags); if (attached_ps->flags & PAINT_STRUCT_FLAG_IS_MASKED)