@@ -121,7 +121,7 @@ void ScriptBuilder::addNullObscuredInput(const std::string &name)
121121 block->setCompileFunction ([](Compiler *compiler) -> CompilerValue * { return compiler->addConstValue (Value ()); });
122122 input->setValueBlock (block);
123123 impl->inputBlocks .push_back (block);
124- impl->blocks . back () ->addInput (input);
124+ impl->lastBlock ->addInput (input);
125125}
126126
127127/* ! Adds a dropdown menu input to the current block. */
@@ -130,11 +130,10 @@ void ScriptBuilder::addDropdownInput(const std::string &name, const std::string
130130 if (!impl->lastBlock )
131131 return ;
132132
133- auto block = impl->blocks .back ();
134133 auto input = std::make_shared<Input>(name, Input::Type::Shadow);
135- block ->addInput (input);
134+ impl-> lastBlock ->addInput (input);
136135
137- auto menu = std::make_shared<Block>(std::to_string (impl->blockId ++), block ->opcode () + " _menu" );
136+ auto menu = std::make_shared<Block>(std::to_string (impl->blockId ++), impl-> lastBlock ->opcode () + " _menu" );
138137 menu->setShadow (true );
139138 impl->inputBlocks .push_back (menu);
140139 input->setValueBlock (menu);
@@ -150,7 +149,7 @@ void ScriptBuilder::addDropdownField(const std::string &name, const std::string
150149 return ;
151150
152151 auto field = std::make_shared<Field>(name, selectedValue);
153- impl->blocks . back () ->addField (field);
152+ impl->lastBlock ->addField (field);
154153}
155154
156155/* !
0 commit comments