Properly fix maze building when paused (#7852)

Also fixes two relevant bugs:
- The error message having no title
- Fixes the controls in the construction window activating when the initial placement fails because of e.g. the game being paused.
This commit is contained in:
Sijmen Schoon 2018-08-04 14:30:13 +02:00 committed by Hielke Morsink
parent 3ccad7c468
commit f3f4776afd
4 changed files with 8 additions and 2 deletions

View File

@ -499,7 +499,7 @@ static void window_maze_construction_construct(int32_t direction)
default:
case RIDE_CONSTRUCTION_STATE_MAZE_FILL:
mode = GC_SET_MAZE_TRACK_FILL;
flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED;
flags = GAME_COMMAND_FLAG_APPLY;
break;
}

View File

@ -3782,6 +3782,7 @@ void ride_construction_tooldown_construct(int32_t screenX, int32_t screenY)
if (_trackPlaceCost == MONEY32_UNDEFINED)
{
_rideConstructionState = RIDE_CONSTRUCTION_STATE_PLACE;
rct_string_id errorText = gGameCommandErrorText;
z -= 8;
if (errorText == STR_NOT_ENOUGH_CASH_REQUIRES || errorText == STR_CAN_ONLY_BUILD_THIS_UNDERWATER

View File

@ -116,6 +116,7 @@ namespace GameActions
GameActionResult::Ptr result = std::make_unique<GameActionResult>();
result->Error = GA_ERROR::GAME_PAUSED;
result->ErrorTitle = STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE;
result->ErrorMessage = STR_CONSTRUCTION_NOT_POSSIBLE_WHILE_GAME_IS_PAUSED;
return result;

View File

@ -77,7 +77,11 @@ public:
uint16_t GetActionFlags() const override
{
return GameAction::GetActionFlags();
uint16_t flags = GameAction::GetActionFlags();
if (GetFlags() & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED)
flags |= GA_FLAGS::ALLOW_WHILE_PAUSED;
return flags;
}
void Serialise(DataSerialiser& stream) override