mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 18:36:43 +00:00
Fix bug in TerrainGrid::getWorldBoundingBox (Fixes #2075)
This commit is contained in:
parent
f7ba1dbfc8
commit
ccab8b1a92
1 changed files with 2 additions and 4 deletions
|
@ -142,10 +142,8 @@ void TerrainGrid::setVisible(bool visible)
|
||||||
|
|
||||||
Ogre::AxisAlignedBox TerrainGrid::getWorldBoundingBox (const Ogre::Vector2& center)
|
Ogre::AxisAlignedBox TerrainGrid::getWorldBoundingBox (const Ogre::Vector2& center)
|
||||||
{
|
{
|
||||||
float cellSize = getStorage()->getCellWorldSize();
|
int cellX = std::floor(center.x);
|
||||||
|
int cellY = std::floor(center.y);
|
||||||
int cellX = std::floor(center.x/cellSize);
|
|
||||||
int cellY = std::floor(center.y/cellSize);
|
|
||||||
|
|
||||||
Grid::iterator it = mGrid.find(std::make_pair(cellX, cellY));
|
Grid::iterator it = mGrid.find(std::make_pair(cellX, cellY));
|
||||||
if (it == mGrid.end())
|
if (it == mGrid.end())
|
||||||
|
|
Loading…
Reference in a new issue