Skip to content

Commit

Permalink
Make new objects created in the editor face in their default directio…
Browse files Browse the repository at this point in the history
…n rather than left. (#2582)

For some reason, the editor would put a (direction "left") entry to all newly created objects (this wouldn't save, but would mess with the object while being loaded after adding it). That includes objects that don't even support LEFT, like the PushButton, which is up and down only.

This fixes that.
  • Loading branch information
Narre authored Aug 15, 2023
1 parent 011c79a commit 7c75baf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/editor/overlay_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ EditorOverlayWidget::put_object()
target_pos = glm::floor(m_sector_pos / static_cast<float>(snap_grid_size)) * static_cast<float>(snap_grid_size);
}

auto object = GameObjectFactory::instance().create(object_class, target_pos, Direction::LEFT);
auto object = GameObjectFactory::instance().create(object_class, target_pos);
object->after_editor_set();

auto* mo = dynamic_cast<MovingObject*> (object.get());
Expand Down

0 comments on commit 7c75baf

Please sign in to comment.