Showing the changes to assignment-client/src/scripts/EntityScriptServer.cpp (1 of 1 file). Show all
Unified · Split
| @@ -324,16 +324,8 @@ void EntityScriptServer::nodeActivated(SharedNodePointer activatedNode) { · 323 unmodified lines | ||
| 324 | 324 | void EntityScriptServer::nodeKilled(SharedNodePointer killedNode) { |
| 325 | 325 | switch (killedNode->getType()) { |
| 326 | 326 | case NodeType::EntityServer: { |
| 327 | − if (!_shuttingDown) { | |
| 328 | − if (_entitiesScriptEngine) { | |
| 329 | − _entitiesScriptEngine->unloadAllEntityScripts(); | |
| 330 | − _entitiesScriptEngine->stop(); | |
| 331 | − } | |
| 332 | − | |
| 333 | − resetEntitiesScriptEngine(); | |
| 334 | − | |
| 335 | − _entityViewer.clear(); | |
| 336 | − } | |
| 327 | + clear(); | |
| 328 | + | |
| 337 | 329 | break; |
| 338 | 330 | } |
| 339 | 331 | case NodeType::Agent: { |
| @@ -440,12 +432,12 @@ void EntityScriptServer::clear() { · 100 unmodified lines | ||
| 440 | 432 | _entitiesScriptEngine->stop(); |
| 441 | 433 | } |
| 442 | 434 | |
| 435 | + _entityViewer.clear(); | |
| 436 | + | |
| 443 | 437 | // reset the engine |
| 444 | 438 | if (!_shuttingDown) { |
| 445 | 439 | resetEntitiesScriptEngine(); |
| 446 | 440 | } |
| 447 | − | |
| 448 | − _entityViewer.clear(); | |
| 449 | 441 | } |
| 450 | 442 | |
| 451 | 443 | void EntityScriptServer::shutdownScriptEngine() { |