mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-02-01 19:25:12 +01:00
Change name of variable spriteId of type EntityId to entityId
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
#include "../network/network.h"
|
||||
#include "../util/Util.h"
|
||||
|
||||
PeepPickupAction::PeepPickupAction(PeepPickupType type, EntityId spriteId, const CoordsXYZ& loc, NetworkPlayerId_t owner)
|
||||
PeepPickupAction::PeepPickupAction(PeepPickupType type, EntityId entityId, const CoordsXYZ& loc, NetworkPlayerId_t owner)
|
||||
: _type(type)
|
||||
, _spriteId(spriteId)
|
||||
, _entityId(entityId)
|
||||
, _loc(loc)
|
||||
, _owner(owner)
|
||||
{
|
||||
@@ -26,7 +26,7 @@ PeepPickupAction::PeepPickupAction(PeepPickupType type, EntityId spriteId, const
|
||||
void PeepPickupAction::AcceptParameters(GameActionParameterVisitor& visitor)
|
||||
{
|
||||
visitor.Visit("type", _type);
|
||||
visitor.Visit("id", _spriteId);
|
||||
visitor.Visit("id", _entityId);
|
||||
visitor.Visit(_loc);
|
||||
visitor.Visit("playerId", _owner);
|
||||
}
|
||||
@@ -40,14 +40,14 @@ void PeepPickupAction::Serialise(DataSerialiser& stream)
|
||||
{
|
||||
GameAction::Serialise(stream);
|
||||
|
||||
stream << DS_TAG(_type) << DS_TAG(_spriteId) << DS_TAG(_loc) << DS_TAG(_owner);
|
||||
stream << DS_TAG(_type) << DS_TAG(_entityId) << DS_TAG(_loc) << DS_TAG(_owner);
|
||||
}
|
||||
|
||||
GameActions::Result PeepPickupAction::Query() const
|
||||
{
|
||||
if (_spriteId.ToUnderlying() >= MAX_ENTITIES || _spriteId.IsNull())
|
||||
if (_entityId.ToUnderlying() >= MAX_ENTITIES || _entityId.IsNull())
|
||||
{
|
||||
log_error("Failed to pick up peep for sprite %d", _spriteId);
|
||||
log_error("Failed to pick up peep for sprite %d", _entityId);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
@@ -56,10 +56,10 @@ GameActions::Result PeepPickupAction::Query() const
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
auto* const peep = TryGetEntity<Peep>(_spriteId);
|
||||
auto* const peep = TryGetEntity<Peep>(_entityId);
|
||||
if (peep == nullptr)
|
||||
{
|
||||
log_error("Failed to pick up peep for sprite %d", _spriteId);
|
||||
log_error("Failed to pick up peep for sprite %d", _entityId);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
@@ -114,10 +114,10 @@ GameActions::Result PeepPickupAction::Query() const
|
||||
|
||||
GameActions::Result PeepPickupAction::Execute() const
|
||||
{
|
||||
Peep* const peep = TryGetEntity<Peep>(_spriteId);
|
||||
Peep* const peep = TryGetEntity<Peep>(_entityId);
|
||||
if (peep == nullptr)
|
||||
{
|
||||
log_error("Failed to pick up peep for sprite %d", _spriteId);
|
||||
log_error("Failed to pick up peep for sprite %d", _entityId);
|
||||
return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,13 +24,13 @@ class PeepPickupAction final : public GameActionBase<GameCommand::PickupGuest>
|
||||
{
|
||||
private:
|
||||
PeepPickupType _type{ PeepPickupType::Count };
|
||||
EntityId _spriteId{ EntityId::GetNull() };
|
||||
EntityId _entityId{ EntityId::GetNull() };
|
||||
CoordsXYZ _loc;
|
||||
NetworkPlayerId_t _owner{ -1 };
|
||||
|
||||
public:
|
||||
PeepPickupAction() = default;
|
||||
PeepPickupAction(PeepPickupType type, EntityId spriteId, const CoordsXYZ& loc, NetworkPlayerId_t owner);
|
||||
PeepPickupAction(PeepPickupType type, EntityId entityId, const CoordsXYZ& loc, NetworkPlayerId_t owner);
|
||||
|
||||
void AcceptParameters(GameActionParameterVisitor& visitor) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user