diff --git a/code/fgame/gamescript.cpp b/code/fgame/gamescript.cpp index 760a7a7c..dd22adeb 100644 --- a/code/fgame/gamescript.cpp +++ b/code/fgame/gamescript.cpp @@ -1108,19 +1108,16 @@ bool ScriptThreadLabel::TrySetScript(const_str label) void ScriptThreadLabel::GetScriptValue(ScriptVariable *var) { - //FIXME: macro: 2 ? + if (!m_Script) { + var->Clear(); + return; + } + ScriptVariable var_array[2]; - if (m_Script) { - var_array[0].setConstStringValue(m_Script->ConstFilename()); - var_array[1].setConstStringValue(m_Label); - var->setConstArrayValue(var_array, 2); - for (int i = 0; i < 2; i++) { - var_array[i].Clear(); - } - } else { - var->Clear(); - } + var_array[0].setConstStringValue(m_Script->ConstFilename()); + var_array[1].setConstStringValue(m_Label); + var->setConstArrayValue(var_array, 2); } bool ScriptThreadLabel::IsSet(void)