mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix rebase
This commit is contained in:
parent
e1e29379ba
commit
eda3188ecf
|
@ -1822,7 +1822,8 @@ Ride* Guest::FindBestRideToGoOn()
|
||||||
Ride* mostExcitingRide = nullptr;
|
Ride* mostExcitingRide = nullptr;
|
||||||
for (auto& ride : GetRideManager())
|
for (auto& ride : GetRideManager())
|
||||||
{
|
{
|
||||||
if (rideConsideration.size() > ride.id && rideConsideration[ride.id])
|
const auto rideIndex = EnumValue(ride.id);
|
||||||
|
if (rideConsideration.size() > rideIndex && rideConsideration[rideIndex])
|
||||||
{
|
{
|
||||||
if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_QUEUE_FULL))
|
if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_QUEUE_FULL))
|
||||||
{
|
{
|
||||||
|
@ -1853,7 +1854,7 @@ std::bitset<MAX_RIDES> Guest::FindRidesToGoOn()
|
||||||
{
|
{
|
||||||
if (!HasRidden(&ride))
|
if (!HasRidden(&ride))
|
||||||
{
|
{
|
||||||
rideConsideration[ride.id] = true;
|
rideConsideration[EnumValue(ride.id)] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1874,7 +1875,7 @@ std::bitset<MAX_RIDES> Guest::FindRidesToGoOn()
|
||||||
for (auto* trackElement : TileElementsView<TrackElement>(location))
|
for (auto* trackElement : TileElementsView<TrackElement>(location))
|
||||||
{
|
{
|
||||||
auto rideIndex = trackElement->GetRideIndex();
|
auto rideIndex = trackElement->GetRideIndex();
|
||||||
rideConsideration[rideIndex] = true;
|
rideConsideration[EnumValue(rideIndex)] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1884,7 +1885,7 @@ std::bitset<MAX_RIDES> Guest::FindRidesToGoOn()
|
||||||
{
|
{
|
||||||
if (ride.highest_drop_height > 66 || ride.excitement >= RIDE_RATING(8, 00))
|
if (ride.highest_drop_height > 66 || ride.excitement >= RIDE_RATING(8, 00))
|
||||||
{
|
{
|
||||||
rideConsideration[ride.id] = true;
|
rideConsideration[EnumValue(ride.id)] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3105,7 +3106,7 @@ template<typename T> static void peep_head_for_nearest_ride(Guest* peep, bool co
|
||||||
{
|
{
|
||||||
if (predicate(ride))
|
if (predicate(ride))
|
||||||
{
|
{
|
||||||
rideConsideration[ride.id] = true;
|
rideConsideration[EnumValue(ride.id)] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3133,18 +3134,18 @@ template<typename T> static void peep_head_for_nearest_ride(Guest* peep, bool co
|
||||||
if (!predicate(*ride))
|
if (!predicate(*ride))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rideConsideration[rideIndex] = true;
|
rideConsideration[EnumValue(ride->id)] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter the considered rides
|
// Filter the considered rides
|
||||||
uint8_t potentialRides[MAX_RIDES];
|
ride_id_t potentialRides[MAX_RIDES];
|
||||||
size_t numPotentialRides = 0;
|
size_t numPotentialRides = 0;
|
||||||
for (auto& ride : GetRideManager())
|
for (auto& ride : GetRideManager())
|
||||||
{
|
{
|
||||||
if (rideConsideration[ride.id])
|
if (rideConsideration[EnumValue(ride.id)])
|
||||||
{
|
{
|
||||||
if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_QUEUE_FULL))
|
if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_QUEUE_FULL))
|
||||||
{
|
{
|
||||||
|
@ -3657,7 +3658,7 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
||||||
ride->FormatNameTo(ft);
|
ride->FormatNameTo(ft);
|
||||||
if (gConfigNotifications.ride_warnings)
|
if (gConfigNotifications.ride_warnings)
|
||||||
{
|
{
|
||||||
News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, CurrentRide, ft);
|
News::AddItemToQueue(News::ItemType::Ride, STR_GUESTS_GETTING_STUCK_ON_RIDE, EnumValue(CurrentRide), ft);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3811,7 +3812,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride)
|
||||||
if (queueTime != ride->stations[CurrentRideStation].QueueTime)
|
if (queueTime != ride->stations[CurrentRideStation].QueueTime)
|
||||||
{
|
{
|
||||||
ride->stations[CurrentRideStation].QueueTime = queueTime;
|
ride->stations[CurrentRideStation].QueueTime = queueTime;
|
||||||
window_invalidate_by_number(WC_RIDE, CurrentRide);
|
window_invalidate_by_number(WC_RIDE, EnumValue(CurrentRide));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PeepFlags & PEEP_FLAGS_TRACKING)
|
if (PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
|
@ -7458,7 +7459,7 @@ void Guest::RemoveRideFromMemory(ride_id_t rideId)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// Ride ids and shop item ids might have the same value, look only for ride thoughts.
|
// Ride ids and shop item ids might have the same value, look only for ride thoughts.
|
||||||
if (IsThoughtShopItemRelated(entry.type) || entry.item != rideId)
|
if (IsThoughtShopItemRelated(entry.type) || entry.rideId != rideId)
|
||||||
{
|
{
|
||||||
it++;
|
it++;
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -966,7 +966,7 @@ template<typename T> std::vector<ride_id_t> RCT12GetRidesBeenOn(T* srcPeep)
|
||||||
{
|
{
|
||||||
if (srcPeep->rides_been_on[i / 8] & (1 << (i % 8)))
|
if (srcPeep->rides_been_on[i / 8] & (1 << (i % 8)))
|
||||||
{
|
{
|
||||||
ridesBeenOn.push_back(i);
|
ridesBeenOn.push_back(static_cast<ride_id_t>(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ridesBeenOn;
|
return ridesBeenOn;
|
||||||
|
|
|
@ -170,7 +170,7 @@ static void ride_all_has_any_track_elements(std::array<bool, RCT12_MAX_RIDES_IN_
|
||||||
if (it.element->IsGhost())
|
if (it.element->IsGhost())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
rideIndexArray[it.element->AsTrack()->GetRideIndex()] = true;
|
rideIndexArray[EnumValue(it.element->AsTrack()->GetRideIndex())] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1330,7 +1330,8 @@ template<> void S6Exporter::ExportEntity(RCT2SpritePeep* dst, const Guest* src)
|
||||||
{
|
{
|
||||||
for (auto rideId : *rideHistory)
|
for (auto rideId : *rideHistory)
|
||||||
{
|
{
|
||||||
dst->rides_been_on[rideId / 8] |= (1 << (rideId % 8));
|
const auto rideIndex = EnumValue(rideId);
|
||||||
|
dst->rides_been_on[rideIndex / 8] |= (1 << (rideIndex % 8));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dst->item_extra_flags = static_cast<uint32_t>(src->GetItemFlags() >> 32);
|
dst->item_extra_flags = static_cast<uint32_t>(src->GetItemFlags() >> 32);
|
||||||
|
|
|
@ -135,18 +135,18 @@ namespace OpenRCT2::Scripting
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ride_id_t ScVehicle::ride_get() const
|
int32_t ScVehicle::ride_get() const
|
||||||
{
|
{
|
||||||
auto vehicle = GetVehicle();
|
auto vehicle = GetVehicle();
|
||||||
return vehicle != nullptr ? vehicle->ride : 0;
|
return EnumValue(vehicle != nullptr ? vehicle->ride : RIDE_ID_NULL);
|
||||||
}
|
}
|
||||||
void ScVehicle::ride_set(ride_id_t value)
|
void ScVehicle::ride_set(int32_t value)
|
||||||
{
|
{
|
||||||
ThrowIfGameStateNotMutable();
|
ThrowIfGameStateNotMutable();
|
||||||
auto vehicle = GetVehicle();
|
auto vehicle = GetVehicle();
|
||||||
if (vehicle != nullptr)
|
if (vehicle != nullptr)
|
||||||
{
|
{
|
||||||
vehicle->ride = value;
|
vehicle->ride = static_cast<ride_id_t>(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@ namespace OpenRCT2::Scripting
|
||||||
uint8_t spriteType_get() const;
|
uint8_t spriteType_get() const;
|
||||||
void spriteType_set(uint8_t value);
|
void spriteType_set(uint8_t value);
|
||||||
|
|
||||||
ride_id_t ride_get() const;
|
int32_t ride_get() const;
|
||||||
void ride_set(ride_id_t value);
|
void ride_set(int32_t value);
|
||||||
|
|
||||||
uint8_t numSeats_get() const;
|
uint8_t numSeats_get() const;
|
||||||
void numSeats_set(uint8_t value);
|
void numSeats_set(uint8_t value);
|
||||||
|
|
|
@ -27,7 +27,7 @@ namespace OpenRCT2::Scripting
|
||||||
|
|
||||||
int32_t ScRide::id_get() const
|
int32_t ScRide::id_get() const
|
||||||
{
|
{
|
||||||
return _rideId;
|
return EnumValue(_rideId);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<ScRideObject> ScRide::object_get()
|
std::shared_ptr<ScRideObject> ScRide::object_get()
|
||||||
|
|
|
@ -431,7 +431,7 @@ namespace OpenRCT2::Scripting
|
||||||
{
|
{
|
||||||
auto el = _element->AsPath();
|
auto el = _element->AsPath();
|
||||||
if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL)
|
if (el->IsQueue() && el->GetRideIndex() != RIDE_ID_NULL)
|
||||||
duk_push_int(ctx, el->GetRideIndex());
|
duk_push_int(ctx, EnumValue(el->GetRideIndex()));
|
||||||
else
|
else
|
||||||
duk_push_null(ctx);
|
duk_push_null(ctx);
|
||||||
break;
|
break;
|
||||||
|
@ -439,13 +439,13 @@ namespace OpenRCT2::Scripting
|
||||||
case TILE_ELEMENT_TYPE_TRACK:
|
case TILE_ELEMENT_TYPE_TRACK:
|
||||||
{
|
{
|
||||||
auto el = _element->AsTrack();
|
auto el = _element->AsTrack();
|
||||||
duk_push_int(ctx, el->GetRideIndex());
|
duk_push_int(ctx, EnumValue(el->GetRideIndex()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||||
{
|
{
|
||||||
auto el = _element->AsEntrance();
|
auto el = _element->AsEntrance();
|
||||||
duk_push_int(ctx, el->GetRideIndex());
|
duk_push_int(ctx, EnumValue(el->GetRideIndex()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
@ -456,7 +456,7 @@ namespace OpenRCT2::Scripting
|
||||||
}
|
}
|
||||||
return DukValue::take_from_stack(ctx);
|
return DukValue::take_from_stack(ctx);
|
||||||
}
|
}
|
||||||
void ScTileElement::ride_set(ride_id_t value)
|
void ScTileElement::ride_set(int32_t value)
|
||||||
{
|
{
|
||||||
ThrowIfGameStateNotMutable();
|
ThrowIfGameStateNotMutable();
|
||||||
switch (_element->GetType())
|
switch (_element->GetType())
|
||||||
|
@ -466,7 +466,7 @@ namespace OpenRCT2::Scripting
|
||||||
auto el = _element->AsPath();
|
auto el = _element->AsPath();
|
||||||
if (!el->HasAddition())
|
if (!el->HasAddition())
|
||||||
{
|
{
|
||||||
el->SetRideIndex(value);
|
el->SetRideIndex(static_cast<ride_id_t>(value));
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -474,14 +474,14 @@ namespace OpenRCT2::Scripting
|
||||||
case TILE_ELEMENT_TYPE_TRACK:
|
case TILE_ELEMENT_TYPE_TRACK:
|
||||||
{
|
{
|
||||||
auto el = _element->AsTrack();
|
auto el = _element->AsTrack();
|
||||||
el->SetRideIndex(value);
|
el->SetRideIndex(static_cast<ride_id_t>(value));
|
||||||
Invalidate();
|
Invalidate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case TILE_ELEMENT_TYPE_ENTRANCE:
|
case TILE_ELEMENT_TYPE_ENTRANCE:
|
||||||
{
|
{
|
||||||
auto el = _element->AsEntrance();
|
auto el = _element->AsEntrance();
|
||||||
el->SetRideIndex(value);
|
el->SetRideIndex(static_cast<ride_id_t>(value));
|
||||||
Invalidate();
|
Invalidate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ namespace OpenRCT2::Scripting
|
||||||
void sequence_set(uint8_t value);
|
void sequence_set(uint8_t value);
|
||||||
|
|
||||||
DukValue ride_get() const;
|
DukValue ride_get() const;
|
||||||
void ride_set(ride_id_t value);
|
void ride_set(int32_t value);
|
||||||
|
|
||||||
DukValue station_get() const;
|
DukValue station_get() const;
|
||||||
void station_set(uint8_t value);
|
void station_set(uint8_t value);
|
||||||
|
|
Loading…
Reference in New Issue