3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 09:35:31 +02:00

Query shape type outside lock

This commit is contained in:
Clement 2019-04-30 17:57:37 -07:00
parent 4821e745cc
commit 281f92e3ea

View file

@ -2023,9 +2023,10 @@ void EntityItem::setCollisionMask(uint16_t value) {
void EntityItem::setDynamic(bool value) {
if (getDynamic() != value) {
auto shapeType = getShapeType();
withWriteLock([&] {
// dynamic and STATIC_MESH are incompatible so we check for that case
if (value && getShapeType() == SHAPE_TYPE_STATIC_MESH) {
if (value && shapeType == SHAPE_TYPE_STATIC_MESH) {
if (_dynamic) {
_dynamic = false;
_flags |= Simulation::DIRTY_MOTION_TYPE;