You've already forked OpenRCT2-Unity
mirror of
https://github.com/izzy2lost/OpenRCT2-Unity.git
synced 2026-03-10 12:38:22 -07:00
Merge pull request #2880 from marijnvdwerf/peep-update-fixing
[WIP] Decompile Peep update fixing
This commit is contained in:
598
src/peep/peep.c
598
src/peep/peep.c
File diff suppressed because it is too large
Load Diff
@@ -231,6 +231,7 @@ enum PEEP_ACTION_EVENTS {
|
||||
PEEP_ACTION_STAFF_FIX = 15,
|
||||
PEEP_ACTION_STAFF_FIX_2 = 16,
|
||||
PEEP_ACTION_STAFF_FIX_GROUND = 17,
|
||||
PEEP_ACTION_STAFF_FIX_3 = 18,
|
||||
PEEP_ACTION_STAFF_WATERING = 19,
|
||||
PEEP_ACTION_JOY = 20,
|
||||
PEEP_ACTION_READ_MAP = 21,
|
||||
|
||||
@@ -7115,6 +7115,9 @@ void invalidate_test_results(int rideIndex)
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006B7481
|
||||
*
|
||||
* @param rideIndex (dl)
|
||||
* @param reliabilityIncreaseFactor (ax)
|
||||
*/
|
||||
void ride_fix_breakdown(int rideIndex, int reliabilityIncreaseFactor)
|
||||
{
|
||||
@@ -7123,7 +7126,7 @@ void ride_fix_breakdown(int rideIndex, int reliabilityIncreaseFactor)
|
||||
ride->lifecycle_flags &= ~RIDE_LIFECYCLE_BREAKDOWN_PENDING;
|
||||
ride->lifecycle_flags &= ~RIDE_LIFECYCLE_BROKEN_DOWN;
|
||||
ride->lifecycle_flags &= ~RIDE_LIFECYCLE_DUE_INSPECTION;
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_CUSTOMER;
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST | RIDE_INVALIDATE_RIDE_MAINTENANCE;
|
||||
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) {
|
||||
rct_vehicle *vehicle;
|
||||
@@ -8146,3 +8149,18 @@ const uint32 ride_customers_in_last_5_minutes(const rct_ride *ride) {
|
||||
+ ride->num_customers[9];
|
||||
return sum;
|
||||
}
|
||||
|
||||
rct_vehicle *ride_get_broken_vehicle(rct_ride *ride) {
|
||||
uint16 vehicleIndex = ride->vehicles[ride->broken_vehicle];
|
||||
|
||||
if (vehicleIndex == 0xFFFF) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rct_vehicle *vehicle = GET_VEHICLE(vehicleIndex);
|
||||
for (uint8 i = 0; i < ride->broken_car; i++) {
|
||||
vehicle = GET_VEHICLE(vehicle->next_vehicle_on_train);
|
||||
}
|
||||
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
@@ -1046,4 +1046,5 @@ void window_ride_construction_mouseup_demolish_next_piece(int x, int y, int z, i
|
||||
const uint32 ride_customers_per_hour(const rct_ride *ride);
|
||||
const uint32 ride_customers_in_last_5_minutes(const rct_ride *ride);
|
||||
|
||||
rct_vehicle * ride_get_broken_vehicle(rct_ride *ride);
|
||||
#endif
|
||||
|
||||
@@ -688,6 +688,8 @@ static int scenario_create_ducks()
|
||||
/**
|
||||
*
|
||||
* rct2: 0x006E37D2
|
||||
*
|
||||
* @return eax
|
||||
*/
|
||||
unsigned int scenario_rand()
|
||||
{
|
||||
|
||||
@@ -5302,3 +5302,24 @@ rct_map_element *map_get_track_element_at_of_type_from_ride(int x, int y, int z,
|
||||
|
||||
return NULL;
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the track element at x, y, z that is the given track type and sequence.
|
||||
* @param x x units, not tiles.
|
||||
* @param y y units, not tiles.
|
||||
* @param z Base height.
|
||||
* @param ride index
|
||||
*/
|
||||
rct_map_element *map_get_track_element_at_from_ride(int x, int y, int z, int rideIndex) {
|
||||
rct_map_element *mapElement = map_get_first_element_at(x >> 5, y >> 5);
|
||||
do {
|
||||
if (map_element_get_type(mapElement) != MAP_ELEMENT_TYPE_TRACK) continue;
|
||||
if (mapElement->base_height != z) continue;
|
||||
if (mapElement->properties.track.ride_index != rideIndex) continue;
|
||||
|
||||
return mapElement;
|
||||
} while (!map_element_is_last_for_tile(mapElement++));
|
||||
|
||||
return NULL;
|
||||
};
|
||||
|
||||
|
||||
@@ -399,5 +399,6 @@ rct_map_element *map_get_track_element_at(int x, int y, int z);
|
||||
rct_map_element *map_get_track_element_at_of_type(int x, int y, int z, int trackType);
|
||||
rct_map_element *map_get_track_element_at_of_type_seq(int x, int y, int z, int trackType, int sequence);
|
||||
rct_map_element *map_get_track_element_at_of_type_from_ride(int x, int y, int z, int trackType, int rideIndex);
|
||||
rct_map_element *map_get_track_element_at_from_ride(int x, int y, int z, int rideIndex);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -74,9 +74,11 @@ void invalidate_sprite_1(rct_sprite *sprite)
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate sprite if not at furthest zoom.
|
||||
* rct2: 0x006EC473
|
||||
*/
|
||||
* Invalidate sprite if not at furthest zoom.
|
||||
* rct2: 0x006EC473
|
||||
*
|
||||
* @param sprite (esi)
|
||||
*/
|
||||
void invalidate_sprite_2(rct_sprite *sprite)
|
||||
{
|
||||
invalidate_sprite_max_zoom(sprite, 2);
|
||||
@@ -415,9 +417,11 @@ void sprite_misc_update_all()
|
||||
/**
|
||||
* Moves a sprite to a new location.
|
||||
* rct2: 0x0069E9D3
|
||||
* ax: x
|
||||
* cx: y
|
||||
* dx: z
|
||||
*
|
||||
* @param x (ax)
|
||||
* @param y (cx)
|
||||
* @param z (dx)
|
||||
* @param sprite (esi)
|
||||
*/
|
||||
void sprite_move(sint16 x, sint16 y, sint16 z, rct_sprite* sprite){
|
||||
if (x < 0 || y < 0 || x > 0x1FFF || y > 0x1FFF)
|
||||
|
||||
Reference in New Issue
Block a user