Merge pull request #2339 from Areloch/MountedCollisionsFix

Adds logic to temporarily disable collisions of mounted objects on Players
This commit is contained in:
Areloch 2019-03-31 12:31:57 -05:00 committed by GitHub
commit fc93bc229c

View file

@ -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();
}
}