Fix the precedent fix. It turns out the code behaves in much weirder ways than I expected.

This was SVN commit r17255.
This commit is contained in:
wraitii
2015-11-14 19:03:20 +00:00
parent 14f53315d6
commit 3760891131
2 changed files with 3 additions and 8 deletions
@@ -95,6 +95,9 @@ void CComponentTypeScript::Deserialize(const CParamNode& paramNode, IDeserialize
JSContext* cx = m_ScriptInterface.GetContext();
JSAutoRequest rq(cx);
m_ScriptInterface.SetProperty(m_Instance, "entity", (int)ent, true, false);
m_ScriptInterface.SetProperty(m_Instance, "template", paramNode, true, false);
// Support a custom "Deserialize" function, to which we pass the deserialized data
// instead of automatically adding the deserialized properties onto the object
if (m_HasCustomDeserialize)
@@ -117,7 +120,4 @@ void CComponentTypeScript::Deserialize(const CParamNode& paramNode, IDeserialize
deserialize.ScriptObjectAppend("object", m_Instance);
}
}
m_ScriptInterface.SetProperty(m_Instance, "entity", (int)ent, true, false);
m_ScriptInterface.SetProperty(m_Instance, "template", paramNode, true, false);
}