Skip to content

Commit

Permalink
[TD] Add handling of cell coords to BaseClass::Read_INI.
Browse files Browse the repository at this point in the history
  • Loading branch information
OmniBlade committed Jun 20, 2024
1 parent 362b2a5 commit 59b8f92
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tiberiandawn/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,18 @@ void BaseClass::Read_INI(CCINIClass& ini)
*/
node.Coord = atol(strtok(NULL, ","));

#ifdef MEGAMAPS
if (Map.MapBinaryVersion != MAP_VERSION_MEGA) {
int x = Coord_X(node.Coord);
int y = Coord_Y(node.Coord);
x >>= 8;
y >>= 8;
CELL cell = XY_Cell(x, y);
cell = Confine_Old_Cell(cell);
node.Coord = Cell_Coord(cell);
}
#endif

/*
** Add this node to the Base's list
*/
Expand Down

0 comments on commit 59b8f92

Please sign in to comment.