Skip to content

Commit 6cf3477

Browse files
committed
lua script setup fix
1 parent 1bc4f76 commit 6cf3477

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/objects/scripting/LuaScript.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@ void LuaScript::updateObjectContent(map<int,shared_ptr<PatchObject>> &patchObjec
170170
pathChanged(watcher.nextEvent());
171171
}
172172

173+
///////////////////////////////////////////
174+
// LUA SETUP
175+
if(scriptLoaded && !isError){
176+
if(!setupTrigger){
177+
setupTrigger = true;
178+
static_cast<LiveCoding *>(_outletParams[1])->lua.scriptSetup();
179+
}
180+
}
181+
///////////////////////////////////////////
182+
173183
if(luaScriptLoaded){
174184
luaScriptLoaded = false;
175185
openScript(lastLuaScript);
@@ -196,10 +206,6 @@ void LuaScript::drawObjectContent(ofxFontStash *font, shared_ptr<ofBaseGLRendere
196206
///////////////////////////////////////////
197207
// LUA UPDATE
198208
if(scriptLoaded && !isError){
199-
if(!setupTrigger){
200-
setupTrigger = true;
201-
static_cast<LiveCoding *>(_outletParams[1])->lua.scriptSetup();
202-
}
203209

204210
// receive external data
205211
if(this->inletsConnected[0]){

0 commit comments

Comments
 (0)