From 87ef9bf15eab5bb14b3a1cab5b368d1b87ded37e Mon Sep 17 00:00:00 2001 From: Areloch Date: Sat, 16 Mar 2019 10:48:00 -0500 Subject: [PATCH] Adds logic to temporarily disable collisions of mounted objects on Players so you don't try colliding with things that are mounted to you when moving. --- Engine/source/T3D/player.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 9a2c072a6..f1feaf833 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -6150,8 +6150,22 @@ void Player::updateWorkingCollisionSet() mWorkingQueryBox.maxExtents += twolPoint; disableCollision(); + + //We temporarily disable the collisions of anything mounted to us so we don't accidentally walk into things we've attached to us + for (SceneObject *ptr = mMount.list; ptr; ptr = ptr->getMountLink()) + { + ptr->disableCollision(); + } + mConvex.updateWorkingList(mWorkingQueryBox, isGhost() ? sClientCollisionContactMask : sServerCollisionContactMask); + + //And now re-enable the collisions of the mounted things + for (SceneObject *ptr = mMount.list; ptr; ptr = ptr->getMountLink()) + { + ptr->enableCollision(); + } + enableCollision(); } }