diff --git a/src/game/Maps/Cell.h b/src/game/Maps/Cell.h index 40de0d0db50..0a3e1677575 100644 --- a/src/game/Maps/Cell.h +++ b/src/game/Maps/Cell.h @@ -25,7 +25,6 @@ #include "GameSystem/TypeContainer.h" #include "GameSystem/TypeContainerVisitor.h" #include "GridDefines.h" -#include class Map; class WorldObject; @@ -49,8 +48,7 @@ struct CellArea struct Cell { - Cell() { data.All = 0; } - Cell(Cell const& cell) { data.All = cell.data.All; } + Cell() : data() { }; explicit Cell(CellPair const& p); void Compute(uint32& x, uint32& y) const @@ -87,26 +85,19 @@ struct Cell data.Part.grid_y*MAX_NUMBER_OF_CELLS+data.Part.cell_y); } - Cell& operator=(Cell const& cell) - { - data.All = cell.data.All; - return *this; - } - bool operator==(Cell const& cell) const { return (data.All == cell.data.All); } bool operator!=(Cell const& cell) const { return !operator==(cell); } union { struct { - unsigned grid_x : 6; - unsigned grid_y : 6; - unsigned cell_x : 6; - unsigned cell_y : 6; - unsigned nocreate : 1; - unsigned reserved : 7; + uint8 grid_x : 8; + uint8 grid_y : 8; + uint8 cell_x : 8; + uint8 cell_y : 8; + uint8 nocreate : 8; } Part; - uint32 All; + uint64 All; } data; template void Visit(CellPair const& cellPair, TypeContainerVisitor& visitor, Map& m, float x, float y, float radius) const; diff --git a/src/game/Maps/CellImpl.h b/src/game/Maps/CellImpl.h index b194becbe0f..92619985d1f 100644 --- a/src/game/Maps/CellImpl.h +++ b/src/game/Maps/CellImpl.h @@ -27,14 +27,13 @@ #include "Map.h" #include -inline Cell::Cell(CellPair const& p) +inline Cell::Cell(CellPair const& p) : data() { data.Part.grid_x = p.x_coord / MAX_NUMBER_OF_CELLS; data.Part.grid_y = p.y_coord / MAX_NUMBER_OF_CELLS; data.Part.cell_x = p.x_coord % MAX_NUMBER_OF_CELLS; data.Part.cell_y = p.y_coord % MAX_NUMBER_OF_CELLS; data.Part.nocreate = 0; - data.Part.reserved = 0; } inline CellArea Cell::CalculateCellArea(float x, float y, float radius)