Fix wrong variable in physics collision loop

In Player::updatePos(), when processing physics collision results, the code was incorrectly using col.object instead of colCheck.object when checking if the collision object is a player.

This caused:
- First iteration: col.object is uninitialized (zeroed), leading to null pointer access
- Subsequent iterations: col.object contains the previous iteration's value, causing incorrect type checks

The fix changes col.object to colCheck.object to properly check the current collision object.
This commit is contained in:
ZombieSoul 2026-03-15 10:15:30 -04:00
parent 3e146f222a
commit 014ab6991a

View file

@ -5169,7 +5169,7 @@ bool Player::updatePos(const F32 travelTime)
Collision& colCheck = collisionList[i];
if (colCheck.object)
{
SceneObject* obj = static_cast<SceneObject*>(col.object);
SceneObject* obj = static_cast<SceneObject*>(colCheck.object);
if (obj->getTypeMask() & PlayerObjectType)
{
_handleCollision( colCheck );