File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 22
33#include < scratchcpp/inputvalue.h>
44#include < scratchcpp/compiler.h>
5- #include < scratchcpp/entity .h>
5+ #include < scratchcpp/block .h>
66#include < scratchcpp/broadcast.h>
77#include < scratchcpp/variable.h>
88#include < scratchcpp/list.h>
@@ -86,6 +86,11 @@ const std::shared_ptr<Block> &InputValue::valueBlock() const
8686void InputValue::setValueBlock (const std::shared_ptr<Block> &newValueBlock)
8787{
8888 impl->valueBlock = newValueBlock;
89+
90+ if (newValueBlock)
91+ impl->valueBlockId = newValueBlock->id ();
92+ else
93+ impl->valueBlockId = " " ;
8994}
9095
9196/* ! Returns the ID of the block. \see valueBlock() */
@@ -98,6 +103,7 @@ const std::string &InputValue::valueBlockId() const
98103void InputValue::setValueBlockId (const std::string &newValueBlockId)
99104{
100105 impl->valueBlockId = newValueBlockId;
106+ impl->valueBlock = nullptr ;
101107}
102108
103109/* ! Returns a pointer to the value (e. g. a variable). */
You can’t perform that action at this time.
0 commit comments