1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 00:34:46 +01:00

Merge pull request #12858 from ju-pinheiro/network-strong-enums

NETWORK_PERMISSION and NETWORK_AUTH replaced by strong enums
This commit is contained in:
Tulio Leao
2020-09-15 08:07:19 -03:00
committed by GitHub
16 changed files with 129 additions and 122 deletions

View File

@@ -69,7 +69,7 @@ namespace OpenRCT2::Scripting
auto permissionIndex = 0;
for (const auto& action : NetworkActions::Actions)
{
if (network_can_perform_action(index, permissionIndex))
if (network_can_perform_action(index, static_cast<NetworkPermission>(permissionIndex)))
{
auto p = TransformPermissionKeyToJS(action.PermissionName);
result.push_back(p);
@@ -113,7 +113,8 @@ namespace OpenRCT2::Scripting
for (size_t i = 0; i < enabledPermissions.size(); i++)
{
auto toggle
= (enabledPermissions[i] != (network_can_perform_action(groupIndex, static_cast<uint32_t>(i)) != 0));
= (enabledPermissions[i]
!= (network_can_perform_action(groupIndex, static_cast<NetworkPermission>(i)) != 0));
if (toggle)
{
auto networkAction2 = NetworkModifyGroupAction(