Object selection now works in the map editor.

This commit is contained in:
Justin Marshall
2020-06-27 15:02:08 -07:00
parent 2101728255
commit b474ea55b3
2 changed files with 6 additions and 2 deletions
+4
View File
@@ -1839,6 +1839,10 @@ bool DisplayClass::Push_Onto_TacMap(COORDINATE & source, COORDINATE & dest)
*=============================================================================================*/
ObjectClass * DisplayClass::Cell_Object(CELL cell, int x, int y) const
{
int tileX, tileY;
CellClass::ScreenCoordsToIsoTile(x, y, tileX, tileY);
x = tileX * CELL_PIXEL_W;
y = tileY * CELL_PIXEL_H;
return(*this)[cell].Cell_Object(x, y);
}
+2 -2
View File
@@ -81,8 +81,8 @@ int MapEditClass::Select_Object(void)
/*
** Convert x,y to offset from cell upper-left
*/
x = (x-TacPixelX) % ICON_PIXEL_W;
y = (y-TacPixelY) % ICON_PIXEL_H;
x = (x - TacPixelX) % ICON_PIXEL_W;
y = (y - TacPixelY) % ICON_PIXEL_H;
/*
** Get object at that x,y