Skip to content

Commit 247e50d

Browse files
committed
Fix dropdown menus in sensing blocks
1 parent 4ae471c commit 247e50d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/blocks/sensingblocks.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ void SensingBlocks::compileTouchingObject(Compiler *compiler)
9999
{
100100
Input *input = compiler->input(TOUCHINGOBJECTMENU);
101101

102-
if (input->type() != Input::Type::ObscuredShadow) {
103-
assert(input->pointsToDropdownMenu());
102+
if (input->pointsToDropdownMenu()) {
104103
std::string value = input->selectedMenuItem();
105104

106105
if (value == "_mouse_")
@@ -128,8 +127,7 @@ void SensingBlocks::compileDistanceTo(Compiler *compiler)
128127
{
129128
Input *input = compiler->input(DISTANCETOMENU);
130129

131-
if (input->type() != Input::Type::ObscuredShadow) {
132-
assert(input->pointsToDropdownMenu());
130+
if (input->pointsToDropdownMenu()) {
133131
std::string value = input->selectedMenuItem();
134132

135133
if (value == "_mouse_")
@@ -224,8 +222,7 @@ void SensingBlocks::compileOf(Compiler *compiler)
224222
assert(input);
225223
BlockFunc f = nullptr;
226224

227-
if (input->type() != Input::Type::ObscuredShadow) {
228-
assert(input->pointsToDropdownMenu());
225+
if (input->pointsToDropdownMenu()) {
229226
std::string value = input->selectedMenuItem();
230227

231228
IEngine *engine = compiler->engine();

test/blocks/sensing_blocks_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class SensingBlocksTest : public testing::Test
8686
else {
8787
auto input = addNullInput(block, name, id);
8888
auto menu = std::make_shared<Block>(block->id() + "_menu", block->opcode() + "_menu");
89+
menu->setShadow(true);
8990
input->setValueBlock(menu);
9091
addDropdownField(menu, name, static_cast<SensingBlocks::Fields>(-1), selectedValue, static_cast<SensingBlocks::FieldValues>(-1));
9192
}

0 commit comments

Comments
 (0)