diff --git a/src/object_gui.cpp b/src/object_gui.cpp --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -565,20 +565,17 @@ public: { if (pt.x == -1) return; - switch (select_proc) { - default: NOT_REACHED(); - case DDSP_BUILD_OBJECT: - if (!_settings_game.construction.freeform_edges) { - /* When end_tile is MP_VOID, the error tile will not be visible to the - * user. This happens when terraforming at the southern border. */ - if (TileX(end_tile) == Map::MaxX()) end_tile += TileDiffXY(-1, 0); - if (TileY(end_tile) == Map::MaxY()) end_tile += TileDiffXY(0, -1); - } - const ObjectSpec *spec = ObjectClass::Get(_selected_object_class)->GetSpec(_selected_object_index); - Command::Post(STR_ERROR_CAN_T_BUILD_OBJECT, CcPlaySound_CONSTRUCTION_OTHER, - end_tile, start_tile, spec->Index(), _selected_object_view, (_ctrl_pressed ? true : false)); - break; + assert(select_proc == DDSP_BUILD_OBJECT); + + if (!_settings_game.construction.freeform_edges) { + /* When end_tile is MP_VOID, the error tile will not be visible to the + * user. This happens when terraforming at the southern border. */ + if (TileX(end_tile) == Map::MaxX()) end_tile += TileDiffXY(-1, 0); + if (TileY(end_tile) == Map::MaxY()) end_tile += TileDiffXY(0, -1); } + const ObjectSpec *spec = ObjectClass::Get(_selected_object_class)->GetSpec(_selected_object_index); + Command::Post(STR_ERROR_CAN_T_BUILD_OBJECT, CcPlaySound_CONSTRUCTION_OTHER, + end_tile, start_tile, spec->Index(), _selected_object_view, (_ctrl_pressed ? true : false)); } void OnPlaceObjectAbort() override