Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 1 file). Show all
Unified · Split
| @@ -297,7 +297,11 @@ void EntityScriptServer::checkAndCallPreload(const EntityItemID& entityID, const · 296 unmodified lines | ||
| 297 | 297 | |
| 298 | 298 | void EntityScriptServer::nodeKilled(SharedNodePointer killedNode) { |
| 299 | 299 | if (killedNode->getType() == NodeType::EntityServer) { |
| 300 | − _entitiesScriptEngine->unloadAllEntityScripts(); | |
| 300 | + if (_entitiesScriptEngine) { | |
| 301 | + _entitiesScriptEngine->unloadAllEntityScripts(); | |
| 302 | + _entitiesScriptEngine->stop(); | |
| 303 | + } | |
| 304 | + | |
| 301 | 305 | resetEntitiesScriptEngine(); |
| 302 | 306 | } |
| 303 | 307 | } |