change getter to return rideId instead of ride pointer

This commit is contained in:
Smitty Penman 2024-04-29 10:02:20 -04:00
parent cb44ce917d
commit 68e9d57ca5
3 changed files with 7 additions and 9 deletions

View File

@ -2782,15 +2782,13 @@ declare global {
lostCountdown: number;
/**
* The guest's current ride or stall destination.
* The guest's current ride or stall destination id.
*
* If set to a `rideId` value, guest will be sent to that ride.
* Has no effect on guests who are on a ride or outside of the park.
*/
rideHeadedTo: number | null;
/**
* Sends a guest to a given ride, regardless of their interest in it.
*/
sendToRide(rideId: number): void;
/**
* The list of thoughts this guest has.
*/

View File

@ -475,7 +475,7 @@ namespace OpenRCT2::Scripting
}
}
std::shared_ptr<ScRide> ScGuest::rideHeadedTo_get() const
RideId ScGuest::rideHeadedTo_get() const
{
auto peep = GetGuest();
if (peep != nullptr)
@ -484,7 +484,7 @@ namespace OpenRCT2::Scripting
auto ride = GetRideManager()[rideId];
if (ride != nullptr)
{
return std::make_shared<ScRide>(ride->id);
return (ride->id);
}
}
return {};

View File

@ -166,7 +166,7 @@ namespace OpenRCT2::Scripting
uint8_t lostCountdown_get() const;
void lostCountdown_set(uint8_t value);
std::shared_ptr<ScRide> rideHeadedTo_get() const;
RideId rideHeadedTo_get() const;
void rideHeadedTo_set(int32_t rideId);
DukValue thoughts_get() const;