Skip to content

Commit 3402d16

Browse files
committed
Engine: Loop through blocks later in getEntity()
1 parent 421ef30 commit 3402d16

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/engine/internal/engine.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1486,11 +1486,6 @@ std::shared_ptr<Comment> Engine::getComment(const std::string &id)
14861486
// Returns the entity with the given ID. \see IEntity
14871487
std::shared_ptr<Entity> Engine::getEntity(const std::string &id)
14881488
{
1489-
// Blocks
1490-
auto block = getBlock(id);
1491-
if (block)
1492-
return std::static_pointer_cast<Entity>(block);
1493-
14941489
// Variables
14951490
auto variable = getVariable(id);
14961491
if (variable)
@@ -1506,6 +1501,11 @@ std::shared_ptr<Entity> Engine::getEntity(const std::string &id)
15061501
if (broadcast)
15071502
return std::static_pointer_cast<Entity>(broadcast);
15081503

1504+
// Blocks
1505+
auto block = getBlock(id);
1506+
if (block)
1507+
return std::static_pointer_cast<Entity>(block);
1508+
15091509
// Comments
15101510
auto comment = getComment(id);
15111511
if (comment)

0 commit comments

Comments
 (0)