mirror of https://github.com/OpenRCT2/OpenRCT2.git
Refactor explicit constructor usage in RideSetAppearanceAction
This commit is contained in:
parent
4a408821fd
commit
bb149d471c
|
@ -55,7 +55,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Query() const
|
||||||
if (ride == nullptr)
|
if (ride == nullptr)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex));
|
log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (_type)
|
switch (_type)
|
||||||
|
@ -66,7 +66,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Query() const
|
||||||
if (_index >= std::size(ride->track_colour))
|
if (_index >= std::size(ride->track_colour))
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command, index %d out of bounds", _index);
|
log_warning("Invalid game command, index %d out of bounds", _index);
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RideSetAppearanceType::VehicleColourBody:
|
case RideSetAppearanceType::VehicleColourBody:
|
||||||
|
@ -75,7 +75,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Query() const
|
||||||
if (_index >= std::size(ride->vehicle_colours))
|
if (_index >= std::size(ride->vehicle_colours))
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command, index %d out of bounds", _index);
|
log_warning("Invalid game command, index %d out of bounds", _index);
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RideSetAppearanceType::VehicleColourScheme:
|
case RideSetAppearanceType::VehicleColourScheme:
|
||||||
|
@ -83,7 +83,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Query() const
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log_warning("Invalid game command, type %d not recognised", _type);
|
log_warning("Invalid game command, type %d not recognised", _type);
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_unique<GameActions::Result>();
|
return std::make_unique<GameActions::Result>();
|
||||||
|
@ -95,7 +95,7 @@ GameActions::Result::Ptr RideSetAppearanceAction::Execute() const
|
||||||
if (ride == nullptr)
|
if (ride == nullptr)
|
||||||
{
|
{
|
||||||
log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex));
|
log_warning("Invalid game command, ride_id = %u", uint32_t(_rideIndex));
|
||||||
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE);
|
return std::make_unique<GameActions::Result>(GameActions::Status::InvalidParameters, STR_NONE, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (_type)
|
switch (_type)
|
||||||
|
|
Loading…
Reference in New Issue