diff --git a/client/gui/CGuiHandler.h b/client/gui/CGuiHandler.h index 86526d5d6..0c4df679d 100644 --- a/client/gui/CGuiHandler.h +++ b/client/gui/CGuiHandler.h @@ -165,6 +165,7 @@ struct SSetCaptureState }; #define OBJ_CONSTRUCTION SObjectConstruction obj__i(this) +#define OBJ_CONSTRUCTION_TARGETED(obj) SObjectConstruction obj__i(obj) #define OBJECT_CONSTRUCTION_CAPTURING(actions) defActions = actions; SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this) #define OBJECT_CONSTRUCTION_CUSTOM_CAPTURING(actions) SSetCaptureState obj__i1(true, actions); SObjectConstruction obj__i(this) diff --git a/client/gui/InterfaceObjectConfigurable.cpp b/client/gui/InterfaceObjectConfigurable.cpp index f6a2f141c..92c0ad701 100644 --- a/client/gui/InterfaceObjectConfigurable.cpp +++ b/client/gui/InterfaceObjectConfigurable.cpp @@ -27,7 +27,7 @@ InterfaceObjectConfigurable::InterfaceObjectConfigurable(const JsonNode & config, int used, Point offset): - CIntObject(used, offset) + InterfaceObjectConfigurable(used, offset) { init(config); } @@ -202,7 +202,7 @@ std::shared_ptr InterfaceObjectConfigurable::buildToggleGroup(cons group->pos += position; if(!config["items"].isNull()) { - SObjectConstruction obj__i(group.get()); + OBJ_CONSTRUCTION_TARGETED(group.get()); int itemIdx = -1; for(const auto & item : config["items"].Vector()) { diff --git a/client/lobby/RandomMapTab.cpp b/client/lobby/RandomMapTab.cpp index 9bf461bcb..9b5cd68da 100644 --- a/client/lobby/RandomMapTab.cpp +++ b/client/lobby/RandomMapTab.cpp @@ -533,7 +533,7 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab): players.push_back(std::make_shared([&, totalPlayers, plId](int sel) { variables["player_id"].Integer() = plId; - SObjectConstruction obj__i(players[plId].get()); + OBJ_CONSTRUCTION_TARGETED(players[plId].get()); for(int teamId = 0; teamId < totalPlayers; ++teamId) { auto button = std::dynamic_pointer_cast(players[plId]->buttons[teamId]); @@ -549,7 +549,7 @@ TeamAlignmentsWidget::TeamAlignmentsWidget(RandomMapTab & randomMapTab): } })); - SObjectConstruction obj__i(players.back().get()); + OBJ_CONSTRUCTION_TARGETED(players.back().get()); for(int teamId = 0; teamId < totalPlayers; ++teamId) { variables["point"]["x"].Integer() = variables["cellOffset"]["x"].Integer() + plId * variables["cellMargin"]["x"].Integer();