From 5cb6d2240af6659a3661c3fb77c6ba6809b483ca Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 14 Sep 2022 21:42:39 +0100 Subject: [PATCH] Add command flag to disable shift-key estimate mode in DoCommandP --- src/command.cpp | 1 + src/command_type.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/command.cpp b/src/command.cpp index fd05fda116..12485062af 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -881,6 +881,7 @@ bool DoCommandPEx(TileIndex tile, uint32 p1, uint32 p2, uint64 p3, uint32 cmd, C bool estimate_only = _shift_pressed && IsLocalCompany() && !_generating_world && !(cmd & CMD_NETWORK_COMMAND) && + !(cmd & CMD_NO_SHIFT_ESTIMATE) && !(GetCommandFlags(cmd) & CMD_NO_EST); /* We're only sending the command, so don't do diff --git a/src/command_type.h b/src/command_type.h index 9409520ef5..9e7d91fef5 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -510,6 +510,7 @@ DECLARE_ENUM_AS_BIT_SET(DoCommandFlag) */ enum FlaggedCommands { CMD_NETWORK_COMMAND = 0x0100, ///< execute the command without sending it on the network + CMD_NO_SHIFT_ESTIMATE = 0x0200, ///< do not check shift key state for whether to estimate command CMD_FLAGS_MASK = 0xFF00, ///< mask for all command flags CMD_ID_MASK = 0x00FF, ///< mask for the command ID };