mirror of
				https://github.com/DarkflameUniverse/DarkflameServer.git
				synced 2025-10-31 12:41:55 +00:00 
			
		
		
		
	Fix bounds check (#1070)
This commit is contained in:
		| @@ -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; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 David Markowitz
					David Markowitz