Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 6 files). Show all
Unified · Split
| @@ -426,12 +426,6 @@ void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& · 425 unmodified lines | |||
| 426 | [=](const EntityItemID& entityID) { | 426 | [=](const EntityItemID& entityID) { |
| 427 | _registeredHandlers.remove(entityID); | 427 | _registeredHandlers.remove(entityID); |
| 428 | }); | 428 | }); |
| 429 | connect(entities.data(), &EntityScriptingInterface::changingEntityID, this, | ||
| 430 | [=](const EntityItemID& oldEntityID, const EntityItemID& newEntityID) { | ||
| 431 | if (!_registeredHandlers.contains(oldEntityID)) return; | ||
| 432 | _registeredHandlers[newEntityID] = _registeredHandlers[oldEntityID]; | ||
| 433 | _registeredHandlers.remove(oldEntityID); | ||
| 434 | }); | ||
| 435 | 429 | ||
| 436 | // Two common cases of event handler, differing only in argument signature. | 430 | // Two common cases of event handler, differing only in argument signature. |
| 437 | auto makeSingleEntityHandler = [=](const QString& eventName) -> std::function<void(const EntityItemID&)> { | 431 | auto makeSingleEntityHandler = [=](const QString& eventName) -> std::function<void(const EntityItemID&)> { |