mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Map editor unit selection now goes down the same pixel accurate system as the main game.
This commit is contained in:
@@ -64,7 +64,6 @@ int MapEditClass::Select_Object(void)
|
||||
{
|
||||
ObjectClass * object=NULL; // Generic object clicked on.
|
||||
int x,y;
|
||||
CELL cell; // Cell that was selected.
|
||||
int rc=0;
|
||||
|
||||
/*
|
||||
@@ -73,24 +72,7 @@ int MapEditClass::Select_Object(void)
|
||||
x = Keyboard->MouseQX;
|
||||
y = Keyboard->MouseQY;
|
||||
|
||||
/*
|
||||
** Get cell for x,y
|
||||
*/
|
||||
cell = Click_Cell_Calc(x, y);
|
||||
if(cell == -1) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
** Convert x,y to offset from cell upper-left
|
||||
*/
|
||||
x = (x - TacPixelX) % ICON_PIXEL_W;
|
||||
y = (y - TacPixelY) % ICON_PIXEL_H;
|
||||
|
||||
/*
|
||||
** Get object at that x,y
|
||||
*/
|
||||
object = Cell_Object(cell, x, y);
|
||||
object = Map.Close_Object(x, y);
|
||||
|
||||
/*
|
||||
** If no object, unselect the current one
|
||||
|
||||
Reference in New Issue
Block a user