Showing the changes to interface/src/scripting/SelectionScriptingInterface.cpp (1 of 4 files). Show all
Unified · Split
| @@ -18,7 +18,9 @@ GameplayObjects::GameplayObjects() { · 17 unmodified lines | |||
| 18 | 18 | ||
| 19 | bool GameplayObjects::addToGameplayObjects(const QUuid& avatarID) { | 19 | bool GameplayObjects::addToGameplayObjects(const QUuid& avatarID) { |
| 20 | containsData = true; | 20 | containsData = true; |
| 21 | _avatarIDs.push_back(avatarID); | 21 | if (std::find(_avatarIDs.begin(), _avatarIDs.end(), avatarID) == _avatarIDs.end()) { |
| 22 | _avatarIDs.push_back(avatarID); | ||
| 23 | } | ||
| 22 | return true; | 24 | return true; |
| 23 | } | 25 | } |
| 24 | bool GameplayObjects::removeFromGameplayObjects(const QUuid& avatarID) { | 26 | bool GameplayObjects::removeFromGameplayObjects(const QUuid& avatarID) { |
| @@ -28,7 +30,9 @@ bool GameplayObjects::removeFromGameplayObjects(const QUuid& avatarID) { · 3 unmodified lines | |||
| 28 | 30 | ||
| 29 | bool GameplayObjects::addToGameplayObjects(const EntityItemID& entityID) { | 31 | bool GameplayObjects::addToGameplayObjects(const EntityItemID& entityID) { |
| 30 | containsData = true; | 32 | containsData = true; |
| 31 | _entityIDs.push_back(entityID); | 33 | if (std::find(_entityIDs.begin(), _entityIDs.end(), entityID) == _entityIDs.end()) { |
| 34 | _entityIDs.push_back(entityID); | ||
| 35 | } | ||
| 32 | return true; | 36 | return true; |
| 33 | } | 37 | } |
| 34 | bool GameplayObjects::removeFromGameplayObjects(const EntityItemID& entityID) { | 38 | bool GameplayObjects::removeFromGameplayObjects(const EntityItemID& entityID) { |
| @@ -38,7 +42,9 @@ bool GameplayObjects::removeFromGameplayObjects(const EntityItemID& entityID) { · 3 unmodified lines | |||
| 38 | 42 | ||
| 39 | bool GameplayObjects::addToGameplayObjects(const OverlayID& overlayID) { | 43 | bool GameplayObjects::addToGameplayObjects(const OverlayID& overlayID) { |
| 40 | containsData = true; | 44 | containsData = true; |
| 41 | _overlayIDs.push_back(overlayID); | 45 | if (std::find(_overlayIDs.begin(), _overlayIDs.end(), overlayID) == _overlayIDs.end()) { |
| 46 | _overlayIDs.push_back(overlayID); | ||
| 47 | } | ||
| 42 | return true; | 48 | return true; |
| 43 | } | 49 | } |
| 44 | bool GameplayObjects::removeFromGameplayObjects(const OverlayID& overlayID) { | 50 | bool GameplayObjects::removeFromGameplayObjects(const OverlayID& overlayID) { |