diff --git a/lib/base/scriptframe.cpp b/lib/base/scriptframe.cpp index c9aec385c..3526c08d4 100644 --- a/lib/base/scriptframe.cpp +++ b/lib/base/scriptframe.cpp @@ -28,6 +28,11 @@ boost::thread_specific_ptr > ScriptFrame::m_ScriptFram ScriptFrame::ScriptFrame(void) : Locals(new Dictionary()), Self(ScriptGlobal::GetGlobals()), Sandboxed(false), Depth(0) { + std::stack *frames = m_ScriptFrames.get(); + + if (frames && !frames->empty()) + Sandboxed = frames->top()->Sandboxed; + PushFrame(this); }