From b59bd449d41ede3db447d31b00dcf3549434266f Mon Sep 17 00:00:00 2001 From: smallmodel <15067410+smallmodel@users.noreply.github.com> Date: Sun, 15 Oct 2023 19:52:02 +0200 Subject: [PATCH] Removed useless Clear() in GetScriptValue() --- code/fgame/gamescript.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) 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)