Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 15 files). Show all
Unified · Split
| @@ -123,10 +123,6 @@ EntityItemID EntityScriptingInterface::editEntity(EntityItemID entityID, const E · 122 unmodified lines | |||
| 123 | // message which takes a list of model id's to delete. | 123 | // message which takes a list of model id's to delete. |
| 124 | void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { | 124 | void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { |
| 125 | 125 | ||
| 126 | // setup properties to kill the model | ||
| 127 | EntityItemProperties properties; | ||
| 128 | properties.setShouldBeDeleted(true); | ||
| 129 | |||
| 130 | EntityItemID actualID = entityID; | 126 | EntityItemID actualID = entityID; |
| 131 | 127 | ||
| 132 | // if the model is unknown, attempt to look it up | 128 | // if the model is unknown, attempt to look it up |
| @@ -138,8 +134,13 @@ void EntityScriptingInterface::deleteEntity(EntityItemID entityID) { · 5 unmodified lines | |||
| 138 | if (actualID.id != UNKNOWN_ENTITY_ID) { | 134 | if (actualID.id != UNKNOWN_ENTITY_ID) { |
| 139 | entityID.id = actualID.id; | 135 | entityID.id = actualID.id; |
| 140 | entityID.isKnownID = true; | 136 | entityID.isKnownID = true; |
| 141 | //qDebug() << "EntityScriptingInterface::deleteEntity()... isKnownID=" << entityID.isKnownID << "id=" << entityID.id << "creatorTokenID=" << entityID.creatorTokenID; | 137 | |
| 142 | queueEntityMessage(PacketTypeEntityAddOrEdit, entityID, properties); | 138 | qDebug() << "EntityScriptingInterface::deleteEntity()... " |
| 139 | << "isKnownID=" << entityID.isKnownID | ||
| 140 | << "id=" << entityID.id | ||
| 141 | << "creatorTokenID=" << entityID.creatorTokenID; | ||
| 142 | |||
| 143 | getEntityPacketSender()->queueEraseEntityMessage(entityID); | ||
| 143 | } | 144 | } |
| 144 | 145 | ||
| 145 | // If we have a local model tree set, then also update it. | 146 | // If we have a local model tree set, then also update it. |