Showing the changes to libraries/physics/src/ObjectDynamic.cpp (1 of 6 files). Show all
Unified · Split
| @@ -24,14 +24,17 @@ ObjectDynamic::ObjectDynamic(EntityDynamicType type, const QUuid& id, EntityItem · 23 unmodified lines | |||
| 24 | ObjectDynamic::~ObjectDynamic() { | 24 | ObjectDynamic::~ObjectDynamic() { |
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | void ObjectDynamic::remapIDs(QHash<EntityItemID, EntityItemID>* map) { | 27 | void ObjectDynamic::remapIDs(QHash<EntityItemID, EntityItemID>& map) { |
| 28 | withWriteLock([&]{ | 28 | withWriteLock([&]{ |
| 29 | if (map->contains(_id)) { | 29 | if (!map.contains(_id)) { |
| 30 | _id = (*map)[_id]; | 30 | map[_id] = QUuid::createUuid(); |
| 31 | } | 31 | } |
| 32 | if (map->contains(_otherID)) { | 32 | _id = map[_id]; |
| 33 | _otherID = (*map)[_otherID]; | 33 | |
| 34 | if (!map.contains(_otherID)) { | ||
| 35 | map[_otherID] = QUuid::createUuid(); | ||
| 34 | } | 36 | } |
| 37 | _otherID = map[_otherID]; | ||
| 35 | }); | 38 | }); |
| 36 | } | 39 | } |
| 37 | 40 | ||