From a88ef0c3250224bc585067d9cad9d8a7f449e25c Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Sun, 4 Feb 2024 16:44:40 -0800 Subject: [PATCH] Update dpGrid.cpp --- dPhysics/dpGrid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dPhysics/dpGrid.cpp b/dPhysics/dpGrid.cpp index 6e38be92..8ec944fd 100644 --- a/dPhysics/dpGrid.cpp +++ b/dPhysics/dpGrid.cpp @@ -77,8 +77,8 @@ void dpGrid::Delete(dpEntity* entity) { int oldCellZ = (int)std::round(entity->m_Position.z) / dpGrid::CELL_SIZE + NUM_CELLS / 2; // Clamp values to the range [0, NUM_CELLS - 1] - cellX = std::clamp(oldCellX, 0, NUM_CELLS - 1); - cellZ = std::clamp(oldCellZ, 0, NUM_CELLS - 1); + oldCellX = std::clamp(oldCellX, 0, NUM_CELLS - 1); + oldCellZ = std::clamp(oldCellZ, 0, NUM_CELLS - 1); auto& cell = m_Cells[oldCellX][oldCellZ]; auto toRemove = std::find(cell.begin(), cell.end(), entity);