mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-03-18 20:00:56 +00:00
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:
parent
3e146f222a
commit
014ab6991a
1 changed files with 1 additions and 1 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue