From 37b8b475c98c0cb4de86c3606c6dcb1bd9ef259c Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Sat, 11 Jul 2020 12:58:18 -0700 Subject: [PATCH] Fixed a bug were isometric units were placed at the wrong coords in the editor. --- code/redalert/mapedplc.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/code/redalert/mapedplc.cpp b/code/redalert/mapedplc.cpp index 1d5d6b3..ae3ede3 100644 --- a/code/redalert/mapedplc.cpp +++ b/code/redalert/mapedplc.cpp @@ -1038,12 +1038,16 @@ int MapEditClass::Place_Object(void) ** sub-position closest to the mouse & put him there */ if (PendingObject->What_Am_I() == RTTI_INFANTRYTYPE) { + int isoMouseX, isoMouseY; + isoMouseX = Get_Mouse_X(); + isoMouseY = Get_Mouse_Y(); + CellClass::ConvertIsoCoordsToScreen(isoMouseX, isoMouseY); /* ** Find cell sub-position */ - if (Is_Spot_Free(Pixel_To_Coord(Get_Mouse_X(), Get_Mouse_Y()))) { - obj_coord = Closest_Free_Spot(Pixel_To_Coord(Get_Mouse_X(), Get_Mouse_Y())); + if (Is_Spot_Free(Pixel_To_Coord(isoMouseX, isoMouseY))) { + obj_coord = Closest_Free_Spot(Pixel_To_Coord(isoMouseX, isoMouseY)); } else { obj_coord = NULL; }