mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Pressing H will now bring you to your MCV/Con_Yard(temp solution). H will no longer put you out of bounds.
This commit is contained in:
@@ -4099,7 +4099,7 @@ void DisplayClass::Set_Tactical_Position(COORDINATE coord)
|
|||||||
int yy = (int)Coord_Y(coord); // - (int)Cell_To_Lepton(MapCellY);
|
int yy = (int)Coord_Y(coord); // - (int)Cell_To_Lepton(MapCellY);
|
||||||
|
|
||||||
// Confine_Rect(&xx, &yy, TacLeptonWidth, TacLeptonHeight, Cell_To_Lepton(MapCellWidth) + GlyphXClientSidebarWidthInLeptons, Cell_To_Lepton(MapCellHeight)); // Needed to accomodate Glyphx client sidebar. ST - 4/12/2019 5:29PM
|
// Confine_Rect(&xx, &yy, TacLeptonWidth, TacLeptonHeight, Cell_To_Lepton(MapCellWidth) + GlyphXClientSidebarWidthInLeptons, Cell_To_Lepton(MapCellHeight)); // Needed to accomodate Glyphx client sidebar. ST - 4/12/2019 5:29PM
|
||||||
//Confine_Rect(&xx, &yy, 0, 0, Cell_To_Lepton(MapCellWidth*2), Cell_To_Lepton(MapCellHeight*2));
|
Confine_Rect(&xx, &yy, 0, 0, Cell_To_Lepton(MapCellWidth), Cell_To_Lepton(MapCellHeight));
|
||||||
coord = XY_Coord(xx, yy);
|
coord = XY_Coord(xx, yy);
|
||||||
|
|
||||||
if (ScenarioInit) {
|
if (ScenarioInit) {
|
||||||
@@ -4396,40 +4396,16 @@ COORDINATE DisplayClass::Center_Map(COORDINATE center)
|
|||||||
bool centerit = false;
|
bool centerit = false;
|
||||||
|
|
||||||
if (CurrentObject.Count()) {
|
if (CurrentObject.Count()) {
|
||||||
|
center = CurrentObject[0]->Render_Coord();
|
||||||
for (int index = 0; index < CurrentObject.Count(); index++) {
|
|
||||||
COORDINATE coord = CurrentObject[index]->Center_Coord();
|
|
||||||
|
|
||||||
x += Coord_X(coord);
|
|
||||||
y += Coord_Y(coord);
|
|
||||||
}
|
|
||||||
|
|
||||||
x /= CurrentObject.Count();
|
|
||||||
y /= CurrentObject.Count();
|
|
||||||
centerit = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (center != 0L) {
|
// Not sure why the math works here with flipped lepton dimensions?
|
||||||
x = Coord_X(center);
|
int xx = Coord_X(center) - (MapCellX * CELL_LEPTON_H);
|
||||||
y = Coord_Y(center);
|
int yy = Coord_Y(center) - (MapCellY * CELL_LEPTON_W);
|
||||||
centerit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (centerit) {
|
Set_Tactical_Position(XY_Coord(xx, yy));
|
||||||
center = XY_Coord(x, y);
|
|
||||||
|
|
||||||
x = x - (int)TacLeptonWidth/2;
|
return center;
|
||||||
if (x < Cell_To_Lepton(MapCellX)) x = Cell_To_Lepton(MapCellX);
|
|
||||||
|
|
||||||
y = y - (int)TacLeptonHeight/2;
|
|
||||||
if (y < Cell_To_Lepton(MapCellY)) y = Cell_To_Lepton(MapCellY);
|
|
||||||
|
|
||||||
Set_Tactical_Position(XY_Coord(x, y));
|
|
||||||
|
|
||||||
return center;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user