mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-12-22 21:43:35 +00:00
Fix bounds check (#1070)
This commit is contained in:
parent
cffb1449d8
commit
7949907517
@ -63,13 +63,13 @@ void dpGrid::Move(dpEntity* entity, float x, float z) {
|
||||
|
||||
if (cellX < 0) cellX = 0;
|
||||
if (cellZ < 0) cellZ = 0;
|
||||
if (cellX > NUM_CELLS) cellX = NUM_CELLS;
|
||||
if (cellZ > NUM_CELLS) cellZ = NUM_CELLS;
|
||||
if (cellX >= NUM_CELLS) cellX = NUM_CELLS - 1;
|
||||
if (cellZ >= NUM_CELLS) cellZ = NUM_CELLS - 1;
|
||||
|
||||
if (oldCellX < 0) oldCellX = 0;
|
||||
if (oldCellZ < 0) oldCellZ = 0;
|
||||
if (oldCellX > NUM_CELLS) oldCellX = NUM_CELLS;
|
||||
if (oldCellZ > NUM_CELLS) oldCellZ = NUM_CELLS;
|
||||
if (oldCellX >= NUM_CELLS) oldCellX = NUM_CELLS - 1;
|
||||
if (oldCellZ >= NUM_CELLS) oldCellZ = NUM_CELLS - 1;
|
||||
|
||||
if (oldCellX == cellX && oldCellZ == cellZ) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user