Close #25515: create a specific permission for the path drag tool (#25675)

This commit is contained in:
Michael Steenbeek authored and GitHub committed 2025-12-21 12:49:17 +01:00
1 parent 8492d408de
commit fcd16cb00a
6 files changed
+24 -1

No files matched your search

+13
View File
@@ -29,6 +29,7 @@
#include <openrct2/audio/Audio.h>
#include <openrct2/core/FlagHolder.hpp>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/network/NetworkAction.h>
#include <openrct2/object/FootpathObject.h>
#include <openrct2/object/FootpathRailingsObject.h>
#include <openrct2/object/FootpathSurfaceObject.h>
@@ -532,6 +533,18 @@ namespace OpenRCT2::Ui::Windows
? WidgetType::imgBtn
: WidgetType::empty;
#ifndef DISABLE_NETWORK
bool canDrag = true;
if (Network::GetMode() == Network::Mode::client)
{
canDrag = Network::CanPerformAction(Network::GetCurrentPlayerGroupIndex(), Network::Permission::dragPathArea);
}
if (canDrag)
disabledWidgets &= ~(1uLL << WIDX_CONSTRUCT_DRAG_AREA);
else
disabledWidgets |= (1uLL << WIDX_CONSTRUCT_DRAG_AREA);
#endif
if (gFootpathSelection.LegacyPath == kObjectEntryIndexNull)
{
widgets[WIDX_RAILINGS_TYPE].type = WidgetType::flatBtn;