mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 22:13:07 +01:00
Fix formatting
This commit is contained in:
committed by
Gymnasiast
parent
e72195d16e
commit
0b7d7027e1
@@ -847,7 +847,8 @@ static void window_multiplayer_groups_scrollmousedown(rct_window* w, int32_t scr
|
||||
w->selected_list_item = index;
|
||||
window_invalidate(w);
|
||||
|
||||
auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::SetPermissions, _selectedGroup, "", index, PermissionState::Toggle);
|
||||
auto networkModifyGroup = NetworkModifyGroupAction(
|
||||
ModifyGroupType::SetPermissions, _selectedGroup, "", index, PermissionState::Toggle);
|
||||
GameActions::Execute(&networkModifyGroup);
|
||||
}
|
||||
|
||||
@@ -871,9 +872,7 @@ static void window_multiplayer_groups_text_input(rct_window* w, rct_widgetindex
|
||||
if (text == nullptr)
|
||||
return;
|
||||
|
||||
|
||||
auto networkModifyGroup = NetworkModifyGroupAction(
|
||||
ModifyGroupType::SetName, _selectedGroup, text);
|
||||
auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::SetName, _selectedGroup, text);
|
||||
GameActions::Execute(&networkModifyGroup);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,9 @@ private:
|
||||
public:
|
||||
NetworkModifyGroupAction() = default;
|
||||
|
||||
NetworkModifyGroupAction(ModifyGroupType type, uint8_t groupId = std::numeric_limits<uint8_t>::max(), const std::string name = "", uint32_t permissionIndex = 0, PermissionState permissionState = PermissionState::Count )
|
||||
NetworkModifyGroupAction(
|
||||
ModifyGroupType type, uint8_t groupId = std::numeric_limits<uint8_t>::max(), const std::string name = "",
|
||||
uint32_t permissionIndex = 0, PermissionState permissionState = PermissionState::Count)
|
||||
: _type(static_cast<uint8_t>(type))
|
||||
, _groupId(groupId)
|
||||
, _name(name)
|
||||
|
||||
@@ -3664,11 +3664,12 @@ GameActionResult::Ptr network_modify_groups(
|
||||
{
|
||||
return std::make_unique<GameActionResult>(GA_ERROR::DISALLOWED, STR_THIS_GROUP_CANNOT_BE_MODIFIED);
|
||||
}
|
||||
for (const auto &it : gNetwork.player_list)
|
||||
for (const auto& it : gNetwork.player_list)
|
||||
{
|
||||
if ((it.get())->Group == groupId)
|
||||
{
|
||||
return std::make_unique<GameActionResult>(GA_ERROR::DISALLOWED, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO);
|
||||
return std::make_unique<GameActionResult>(
|
||||
GA_ERROR::DISALLOWED, STR_CANT_REMOVE_GROUP_THAT_PLAYERS_BELONG_TO);
|
||||
}
|
||||
}
|
||||
if (isExecuting)
|
||||
@@ -3758,6 +3759,10 @@ GameActionResult::Ptr network_modify_groups(
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
log_error("Invalid Modify Group Type: %u", static_cast<uint8_t>(type));
|
||||
return std::make_unique<GameActionResult>(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
||||
break;
|
||||
}
|
||||
|
||||
gNetwork.SaveGroups();
|
||||
|
||||
Reference in New Issue
Block a user