diff --git a/src/command.cpp b/src/command.cpp index 8d5e1e9a41..1487aa8aec 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -555,15 +555,18 @@ bool DoCommandP(TileIndex tile, uint32 p1, uint32 p2, uint32 cmd, CommandCallbac * However, in case of incoming network commands or * map generation we do want to execute. */ bool estimate_only = false; - switch (_command_proc_table[cmd & CMD_ID_MASK].type) { - case CMDT_LANDSCAPE_CONSTRUCTION: - case CMDT_VEHICLE_CONSTRUCTION: - estimate_only = _shift_pressed && IsLocalCompany() && - !_generating_world && !(cmd & CMD_NETWORK_COMMAND); - break; - default: - break; // just to silence warnings + if (!(cmd & CMD_NO_ESTIMATE)) { + switch (_command_proc_table[cmd & CMD_ID_MASK].type) { + case CMDT_LANDSCAPE_CONSTRUCTION: + case CMDT_VEHICLE_CONSTRUCTION: + estimate_only = _shift_pressed && IsLocalCompany() && + !_generating_world && !(cmd & CMD_NETWORK_COMMAND); + break; + default: + break; // just to silence warnings + } } + cmd &= ~CMD_NO_ESTIMATE; /* We're only sending the command, so don't do * fancy things for 'success'. */ diff --git a/src/command_type.h b/src/command_type.h index c6452a47a6..c9fb9c313c 100644 --- a/src/command_type.h +++ b/src/command_type.h @@ -372,6 +372,7 @@ DECLARE_ENUM_AS_BIT_SET(DoCommandFlag) */ enum FlaggedCommands { CMD_NETWORK_COMMAND = 0x0100, ///< execute the command without sending it on the network + CMD_NO_ESTIMATE = 0x0200, ///< execute command instead of doing estimate even if shift is pressed CMD_FLAGS_MASK = 0xFF00, ///< mask for all command flags CMD_ID_MASK = 0x00FF, ///< mask for the command ID }; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index ce7e9834cc..5f7d8d4015 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -861,7 +861,7 @@ static void DoRegularFunding(Town *t) CompanyByte old = _current_company; _current_company = _local_company; - DoCommandP(t->xy, t->index, HK_FUND, CMD_DO_TOWN_ACTION); + DoCommandP(t->xy, t->index, HK_FUND, CMD_DO_TOWN_ACTION | CMD_NO_ESTIMATE); _current_company = old; } } @@ -892,7 +892,7 @@ static void DoRegularAdvertising(Town *t) { CompanyByte old = _current_company; _current_company = _local_company; - DoCommandP(t->xy, t->index, HK_LADVERT, CMD_DO_TOWN_ACTION); + DoCommandP(t->xy, t->index, HK_LADVERT, CMD_DO_TOWN_ACTION | CMD_NO_ESTIMATE); _current_company = old; }