Remove global from PlaceParkEntranceAction

This commit is contained in:
Gymnasiast 2021-04-14 15:03:09 +02:00
parent 5e28586a1c
commit 084bfe0d48
No known key found for this signature in database
GPG Key ID: DBFFF47AB2CA3EDD
4 changed files with 7 additions and 5 deletions

View File

@ -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)
{

View File

@ -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);

View File

@ -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())
{

View File

@ -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;