From 6b0b19d36dff8daa9a68a38170d93b221888b2a4 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 18 Jan 2017 17:45:14 -0800 Subject: [PATCH] Unload all scripts on entity server loss --- assignment-client/src/scripts/EntityScriptServer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assignment-client/src/scripts/EntityScriptServer.cpp b/assignment-client/src/scripts/EntityScriptServer.cpp index fba375aeef..f06d1a5b6f 100644 --- a/assignment-client/src/scripts/EntityScriptServer.cpp +++ b/assignment-client/src/scripts/EntityScriptServer.cpp @@ -253,7 +253,10 @@ void EntityScriptServer::checkAndCallPreload(const EntityItemID& entityID, const } void EntityScriptServer::nodeKilled(SharedNodePointer killedNode) { - + if (killedNode->getType() == NodeType::EntityServer) { + _entitiesScriptEngine->unloadAllEntityScripts(); + resetEntitiesScriptEngine(); + } } void EntityScriptServer::sendStatsPacket() {