mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-19 04:53:12 +01:00
Remove global from PlaceParkEntranceAction
This commit is contained in:
@@ -1327,7 +1327,7 @@ static void window_map_place_park_entrance_tool_down(const ScreenCoordsXY& scree
|
||||
CoordsXYZD parkEntrancePosition = place_park_entrance_get_map_position(screenCoords);
|
||||
if (!parkEntrancePosition.isNull())
|
||||
{
|
||||
auto gameAction = PlaceParkEntranceAction(parkEntrancePosition);
|
||||
auto gameAction = PlaceParkEntranceAction(parkEntrancePosition, gFootpathSelectedId);
|
||||
auto result = GameActions::Execute(&gameAction);
|
||||
if (result->Error == GameActions::Status::Ok)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ money32 park_entrance_place_ghost(const CoordsXYZD& entranceLoc)
|
||||
{
|
||||
park_entrance_remove_ghost();
|
||||
|
||||
auto gameAction = PlaceParkEntranceAction(entranceLoc);
|
||||
auto gameAction = PlaceParkEntranceAction(entranceLoc, gFootpathSelectedId);
|
||||
gameAction.SetFlags(GAME_COMMAND_FLAG_GHOST);
|
||||
|
||||
auto result = GameActions::Execute(&gameAction);
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
#include "../world/Sprite.h"
|
||||
#include "../world/Surface.h"
|
||||
|
||||
PlaceParkEntranceAction::PlaceParkEntranceAction(const CoordsXYZD& location)
|
||||
PlaceParkEntranceAction::PlaceParkEntranceAction(const CoordsXYZD& location, ObjectEntryIndex pathType)
|
||||
: _loc(location)
|
||||
, _pathType(pathType)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -146,7 +147,7 @@ GameActions::Result::Ptr PlaceParkEntranceAction::Execute() const
|
||||
entranceElement->SetDirection(_loc.direction);
|
||||
entranceElement->SetSequenceIndex(index);
|
||||
entranceElement->SetEntranceType(ENTRANCE_TYPE_PARK_ENTRANCE);
|
||||
entranceElement->SetPathType(gFootpathSelectedId);
|
||||
entranceElement->SetPathType(_pathType);
|
||||
|
||||
if (!entranceElement->IsGhost())
|
||||
{
|
||||
|
||||
@@ -15,10 +15,11 @@ DEFINE_GAME_ACTION(PlaceParkEntranceAction, GameCommand::PlaceParkEntrance, Game
|
||||
{
|
||||
private:
|
||||
CoordsXYZD _loc;
|
||||
ObjectEntryIndex _pathType;
|
||||
|
||||
public:
|
||||
PlaceParkEntranceAction() = default;
|
||||
PlaceParkEntranceAction(const CoordsXYZD& location);
|
||||
PlaceParkEntranceAction(const CoordsXYZD& location, ObjectEntryIndex pathType);
|
||||
|
||||
uint16_t GetActionFlags() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user