mirror of https://github.com/OpenRCT2/OpenRCT2.git
Compare commits
4 Commits
1092bba26d
...
90f9e97ae7
Author | SHA1 | Date |
---|---|---|
ltsSmitty | 90f9e97ae7 | |
Harry Hopkinson | 9266a6f0d3 | |
Michael Steenbeek | 03926c46d0 | |
Smitty Penman | f147f3f867 |
|
@ -64,9 +64,9 @@ set(TITLE_SEQUENCE_VERSION "0.4.6")
|
|||
set(TITLE_SEQUENCE_URL "https://github.com/OpenRCT2/title-sequences/releases/download/v${TITLE_SEQUENCE_VERSION}/title-sequences.zip")
|
||||
set(TITLE_SEQUENCE_SHA1 "80fefc6ebbabc42a6f4703412daa5c62f661420d")
|
||||
|
||||
set(OBJECTS_VERSION "1.4.3")
|
||||
set(OBJECTS_VERSION "1.4.4")
|
||||
set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip")
|
||||
set(OBJECTS_SHA1 "ac78210ef46465c0f51bbffd6fe21845092af48e")
|
||||
set(OBJECTS_SHA1 "4e9b5d7f85a07b90ec57fe37517e04b19ee0395c")
|
||||
|
||||
set(OPENSFX_VERSION "1.0.5")
|
||||
set(OPENSFX_URL "https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v${OPENSFX_VERSION}/opensound.zip")
|
||||
|
|
|
@ -119,6 +119,7 @@ Appreciation for contributors who have provided substantial work, but are no lon
|
|||
* Tiago Reul (reul) - Misc.
|
||||
* Fredrik Tegnell (fredriktegnell) - Misc.
|
||||
* Alex Parisi (alex-parisi) - Added API for returning metadata from all registered plugins.
|
||||
* Smitty Penman (ltsSmitty) - Add API for sending guest to rides
|
||||
|
||||
## Bug fixes & Refactors
|
||||
* Claudio Tiecher (janclod)
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
- Fix: [#21696] Fullscreen window option not correctly applied on macOS.
|
||||
- Fix: [#21787] Map generator heightmap should respect increased height limits.
|
||||
- Fix: [#21829] When creating a new scenario, the default name contains formatting codes.
|
||||
- Fix: [objects#324] Cannot build Colosseum inside a turn or helix.
|
||||
- Fix: [objects#325] Sloped castle walls are vertically offset by one pixel (original bug).
|
||||
|
||||
0.4.10 (2024-04-02)
|
||||
------------------------------------------------------------------------
|
||||
|
|
|
@ -2781,6 +2781,16 @@ declare global {
|
|||
*/
|
||||
lostCountdown: number;
|
||||
|
||||
/**
|
||||
* The guest's current ride or stall destination.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
<LibsSha1 Condition="'$(Platform)'=='Win32'">f3636b530110c7592deab23ca0d0c1916fc7e44c</LibsSha1>
|
||||
<TitleSequencesUrl>https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.6/title-sequences.zip</TitleSequencesUrl>
|
||||
<TitleSequencesSha1>80fefc6ebbabc42a6f4703412daa5c62f661420d</TitleSequencesSha1>
|
||||
<ObjectsUrl>https://github.com/OpenRCT2/objects/releases/download/v1.4.3/objects.zip</ObjectsUrl>
|
||||
<ObjectsSha1>ac78210ef46465c0f51bbffd6fe21845092af48e</ObjectsSha1>
|
||||
<ObjectsUrl>https://github.com/OpenRCT2/objects/releases/download/v1.4.4/objects.zip</ObjectsUrl>
|
||||
<ObjectsSha1>4e9b5d7f85a07b90ec57fe37517e04b19ee0395c</ObjectsSha1>
|
||||
<OpenSFXUrl>https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.5/opensound.zip</OpenSFXUrl>
|
||||
<OpenSFXSha1>b1b1f1b241d2cbff63a1889c4dc5a09bdf769bfb</OpenSFXSha1>
|
||||
<OpenMSXUrl>https://github.com/OpenRCT2/OpenMusic/releases/download/v1.5/openmusic.zip</OpenMSXUrl>
|
||||
|
|
|
@ -103,6 +103,7 @@ enum class CheatType : int32_t
|
|||
AllowRegularPathAsQueue,
|
||||
AllowSpecialColourSchemes,
|
||||
RemoveParkFences,
|
||||
SendGuestToRide,
|
||||
Count,
|
||||
};
|
||||
|
||||
|
|
|
@ -264,6 +264,13 @@ GameActions::Result CheatSetAction::Execute() const
|
|||
case CheatType::RemoveParkFences:
|
||||
RemoveParkFences();
|
||||
break;
|
||||
case CheatType::SendGuestToRide:
|
||||
{
|
||||
EntityId guestId = EntityId::FromUnderlying(_param1);
|
||||
RideId rideId = RideId::FromUnderlying(_param2);
|
||||
SendGuestToRide(guestId, rideId);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
{
|
||||
LOG_ERROR("Invalid cheat type %d", _cheatType.id);
|
||||
|
@ -414,6 +421,8 @@ ParametersRange CheatSetAction::GetParameterRange(CheatType cheatType) const
|
|||
[[fallthrough]];
|
||||
case CheatType::RemoveParkFences:
|
||||
return { { 0, 0 }, { 0, 0 } };
|
||||
case CheatType::SendGuestToRide:
|
||||
return { { 0, MAX_ENTITIES}, { 0, 10000} };
|
||||
case CheatType::Count:
|
||||
break;
|
||||
}
|
||||
|
@ -822,3 +831,14 @@ void CheatSetAction::RemoveParkFences() const
|
|||
|
||||
GfxInvalidateScreen();
|
||||
}
|
||||
|
||||
void CheatSetAction::SendGuestToRide(EntityId guestId, RideId rideId) const
|
||||
{
|
||||
auto guest = TryGetEntity<Guest>(guestId);
|
||||
if (guest != nullptr)
|
||||
{
|
||||
{
|
||||
guest->SendToRide(rideId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,4 +55,5 @@ private:
|
|||
void ParkSetOpen(bool isOpen) const;
|
||||
void CreateDucks(int count) const;
|
||||
void RemoveParkFences() const;
|
||||
void SendGuestToRide(EntityId guestId, RideId rideId) const;
|
||||
};
|
||||
|
|
|
@ -1805,6 +1805,52 @@ void Guest::OnExitRide(Ride& ride)
|
|||
ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
|
||||
}
|
||||
|
||||
|
||||
void Guest::SendToRide(RideId rideId)
|
||||
{
|
||||
if (rideId.IsNull())
|
||||
return;
|
||||
Ride* ride = GetRide(rideId);
|
||||
if (ride == nullptr)
|
||||
return;
|
||||
if (x == LOCATION_NULL)
|
||||
return;
|
||||
|
||||
// Make the guest stay in the park
|
||||
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||
{
|
||||
PeepFlags &= ~PEEP_FLAGS_LEAVING_PARK;
|
||||
}
|
||||
/**
|
||||
* Ideally it would also be able affect guests that are
|
||||
* PeepState::Queuing and PeepState::QueuingFront for a different ride,
|
||||
* but there's some issue causing the game to crash
|
||||
* when the original ride tries processing its depleted queue.
|
||||
*/
|
||||
if (
|
||||
State != PeepState::Walking &&
|
||||
State != PeepState::Sitting &&
|
||||
State != PeepState::Watching &&
|
||||
State != PeepState::UsingBin
|
||||
)
|
||||
return;
|
||||
|
||||
// Head to that ride
|
||||
SetState(PeepState::Walking);
|
||||
GuestHeadingToRideId = ride->id;
|
||||
GuestIsLostCountdown = 200;
|
||||
TimeLost = 0;
|
||||
ResetPathfindGoal();
|
||||
WindowInvalidateFlags |= PEEP_INVALIDATE_PEEP_ACTION;
|
||||
|
||||
|
||||
// Make peep look at their map if they have one
|
||||
if (HasItem(ShopItem::Map))
|
||||
{
|
||||
ReadMap();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x00695DD2
|
||||
|
|
|
@ -335,6 +335,7 @@ public:
|
|||
void TryGetUpFromSitting();
|
||||
bool ShouldRideWhileRaining(const Ride& ride);
|
||||
void ChoseNotToGoOnRide(const Ride& ride, bool peepAtRide, bool updateLastRide);
|
||||
void SendToRide(RideId rideId);
|
||||
void PickRideToGoOn();
|
||||
void ReadMap();
|
||||
bool ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, bool thinking);
|
||||
|
|
|
@ -1625,19 +1625,12 @@ constexpr CoordsXY defaultRightQuarterTurn3TilesBoundLengths[4][3] = {
|
|||
},
|
||||
};
|
||||
|
||||
static constexpr int8_t right_quarter_turn_3_tiles_sprite_map[] = {
|
||||
0,
|
||||
-1,
|
||||
1,
|
||||
2,
|
||||
};
|
||||
|
||||
void TrackPaintUtilRightQuarterTurn3TilesPaint(
|
||||
PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence,
|
||||
const ImageId colourFlags, const uint32_t sprites[4][3], const CoordsXY offsets[4][3], const CoordsXY boundsLengths[4][3],
|
||||
const CoordsXYZ boundsOffsets[4][3])
|
||||
{
|
||||
int32_t index = right_quarter_turn_3_tiles_sprite_map[trackSequence];
|
||||
int32_t index = kRightQuarterTurn3TilesSpriteMap[trackSequence];
|
||||
if (index < 0)
|
||||
{
|
||||
return;
|
||||
|
@ -1665,7 +1658,7 @@ void TrackPaintUtilRightQuarterTurn3TilesPaint2WithHeightOffset(
|
|||
PaintSession& session, int8_t thickness, int16_t height, Direction direction, uint8_t trackSequence,
|
||||
const ImageId colourFlags, const uint32_t sprites[4][3], int32_t heightOffset)
|
||||
{
|
||||
int8_t sprite = right_quarter_turn_3_tiles_sprite_map[trackSequence];
|
||||
int8_t sprite = kRightQuarterTurn3TilesSpriteMap[trackSequence];
|
||||
if (sprite < 0)
|
||||
{
|
||||
return;
|
||||
|
@ -1753,7 +1746,7 @@ void TrackPaintUtilRightQuarterTurn3TilesPaint3(
|
|||
PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags,
|
||||
const SpriteBb sprites[4][3])
|
||||
{
|
||||
int8_t sprite = right_quarter_turn_3_tiles_sprite_map[trackSequence];
|
||||
int8_t sprite = kRightQuarterTurn3TilesSpriteMap[trackSequence];
|
||||
if (sprite < 0)
|
||||
{
|
||||
return;
|
||||
|
@ -1770,7 +1763,7 @@ void TrackPaintUtilRightQuarterTurn3TilesPaint4(
|
|||
PaintSession& session, int16_t height, Direction direction, uint8_t trackSequence, const ImageId colourFlags,
|
||||
const SpriteBb sprites[4][3])
|
||||
{
|
||||
int8_t sprite = right_quarter_turn_3_tiles_sprite_map[trackSequence];
|
||||
int8_t sprite = kRightQuarterTurn3TilesSpriteMap[trackSequence];
|
||||
if (sprite < 0)
|
||||
{
|
||||
return;
|
||||
|
|
|
@ -258,6 +258,8 @@ extern const CoordsXY defaultRightQuarterTurn3TilesOffsets[4][3];
|
|||
extern const CoordsXYZ defaultRightQuarterTurn3TilesBoundOffsets[4][3];
|
||||
extern const CoordsXY defaultRightQuarterTurn3TilesBoundLengths[4][3];
|
||||
|
||||
constexpr int8_t kRightQuarterTurn3TilesSpriteMap[] = { 0, -1, 1, 2 };
|
||||
|
||||
extern const CoordsXY defaultRightHelixUpSmallQuarterBoundLengths[4][3][2];
|
||||
extern const CoordsXYZ defaultRightHelixUpSmallQuarterBoundOffsets[4][3][2];
|
||||
|
||||
|
|
|
@ -1392,9 +1392,7 @@ static void PaintMiniatureRailwayTrackRightQuarterTurn3Tiles(
|
|||
miniature_railway_right_quarter_turn_3_tile_track_floor, nullptr, defaultRightQuarterTurn3TilesBoundLengths,
|
||||
miniature_railway_right_quarter_turn_3_tile_bound_offsets);
|
||||
|
||||
static constexpr int8_t _right_quarter_turn_3_tiles_sprite_map[] = { 0, -1, 1, 2 };
|
||||
|
||||
int32_t index = _right_quarter_turn_3_tiles_sprite_map[trackSequence];
|
||||
int32_t index = kRightQuarterTurn3TilesSpriteMap[trackSequence];
|
||||
|
||||
auto imageId = session.TrackColours.WithIndex(
|
||||
miniature_railway_track_pieces_flat_quarter_turn_3_tiles[direction][index]);
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
# include "../../../entity/Guest.h"
|
||||
# include "../../../localisation/Localisation.h"
|
||||
# include "../ride/ScRide.hpp"
|
||||
|
||||
namespace OpenRCT2::Scripting
|
||||
{
|
||||
|
@ -174,6 +175,8 @@ namespace OpenRCT2::Scripting
|
|||
dukglue_register_property(ctx, &ScGuest::lostCountdown_get, &ScGuest::lostCountdown_set, "lostCountdown");
|
||||
dukglue_register_property(ctx, &ScGuest::thoughts_get, nullptr, "thoughts");
|
||||
dukglue_register_property(ctx, &ScGuest::items_get, nullptr, "items");
|
||||
dukglue_register_property(ctx, &ScGuest::rideHeadedTo_get, nullptr, "rideHeadedTo");
|
||||
dukglue_register_method(ctx, &ScGuest::rideHeadedTo_set, "sendToRide");
|
||||
dukglue_register_method(ctx, &ScGuest::has_item, "hasItem");
|
||||
dukglue_register_method(ctx, &ScGuest::give_item, "giveItem");
|
||||
dukglue_register_method(ctx, &ScGuest::remove_item, "removeItem");
|
||||
|
@ -472,6 +475,32 @@ namespace OpenRCT2::Scripting
|
|||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<ScRide> ScGuest::rideHeadedTo_get() const
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
auto peep = GetGuest();
|
||||
if (peep != nullptr)
|
||||
{
|
||||
auto rideId = peep->GuestHeadingToRideId;
|
||||
auto ride = GetRideManager()[rideId];
|
||||
if (ride != nullptr)
|
||||
{
|
||||
return std::make_shared<ScRide>(ride->id);
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
void ScGuest::rideHeadedTo_set(int32_t rideId)
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
auto peep = GetGuest();
|
||||
if (peep != nullptr)
|
||||
{
|
||||
peep->SendToRide(RideId::FromUnderlying(rideId));
|
||||
}
|
||||
}
|
||||
|
||||
DukValue ScGuest::thoughts_get() const
|
||||
{
|
||||
auto ctx = GetContext()->GetScriptEngine().GetContext();
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
|
||||
# include "../../../entity/Guest.h"
|
||||
# include "ScPeep.hpp"
|
||||
# include "../ride/ScRide.hpp"
|
||||
|
||||
namespace OpenRCT2::Scripting
|
||||
{
|
||||
|
@ -165,6 +166,9 @@ namespace OpenRCT2::Scripting
|
|||
uint8_t lostCountdown_get() const;
|
||||
void lostCountdown_set(uint8_t value);
|
||||
|
||||
std::shared_ptr<ScRide> rideHeadedTo_get() const;
|
||||
void rideHeadedTo_set(int32_t rideId);
|
||||
|
||||
DukValue thoughts_get() const;
|
||||
|
||||
DukValue items_get() const;
|
||||
|
|
Loading…
Reference in New Issue