forked from rosebudai/OpenRCT2-Web
Replace magic numbers with constant SPRITE_INDEX_NULL
This commit is contained in:
1 parent
2b35986746
commit
4fbecc2f60
10 files changed
+52
-52
No files matched your search
@@ -345,7 +345,7 @@ static void cheat_remove_all_guests()
|
||||
|
||||
for(int i=0;i<4;i++) {
|
||||
ride->queue_length[i] = 0;
|
||||
ride->last_peep_in_queue[i]=0xFFFF;
|
||||
ride->last_peep_in_queue[i] = SPRITE_INDEX_NULL;
|
||||
}
|
||||
}
|
||||
window_invalidate_by_class(WC_RIDE);
|
||||
|
||||
@@ -745,7 +745,7 @@ void lightfx_add_lights_magic_vehicles()
|
||||
case RIDE_TYPE_SPLASH_BOATS:
|
||||
case RIDE_TYPE_WATER_COASTER: {
|
||||
rct_vehicle *vehicle_draw = vehicle_get_head(vehicle);
|
||||
if (vehicle_draw->next_vehicle_on_train != 0xFFFF) {
|
||||
if (vehicle_draw->next_vehicle_on_train != SPRITE_INDEX_NULL) {
|
||||
vehicle_draw = GET_VEHICLE(vehicle_draw->next_vehicle_on_train);
|
||||
}
|
||||
place_x = vehicle_draw->x;
|
||||
|
||||
+12
-12
@@ -2368,7 +2368,7 @@ void remove_peep_from_queue(rct_peep* peep)
|
||||
}
|
||||
|
||||
uint16 spriteId = ride->last_peep_in_queue[cur_station];
|
||||
while (spriteId != 0xFFFF) {
|
||||
while (spriteId != SPRITE_INDEX_NULL) {
|
||||
rct_peep* other_peep = GET_PEEP(spriteId);
|
||||
if (peep->sprite_index == other_peep->next_in_queue){
|
||||
other_peep->next_in_queue = peep->next_in_queue;
|
||||
@@ -2543,7 +2543,7 @@ static void peep_update_ride_sub_state_0(rct_peep* peep){
|
||||
uint16 vehicle_id = ride->vehicles[chosen_train];
|
||||
rct_vehicle* vehicle = GET_VEHICLE(vehicle_id);
|
||||
|
||||
for (; vehicle_id != 0xFFFF;
|
||||
for (; vehicle_id != SPRITE_INDEX_NULL;
|
||||
vehicle_id = vehicle->next_vehicle_on_train,
|
||||
i++){
|
||||
vehicle = GET_VEHICLE(vehicle_id);
|
||||
@@ -2565,7 +2565,7 @@ static void peep_update_ride_sub_state_0(rct_peep* peep){
|
||||
ride->mode == RIDE_MODE_BACKWARD_ROTATION)
|
||||
{
|
||||
uint8 position = (((~vehicle->vehicle_sprite_type + 1) >> 3) & 0xF) * 2;
|
||||
if (vehicle->peep[position] != 0xFFFF)
|
||||
if (vehicle->peep[position] != SPRITE_INDEX_NULL)
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2984,19 +2984,19 @@ static void peep_update_ride_sub_state_2_rejoin_queue(rct_peep* peep, rct_ride*
|
||||
peep->sub_state = 0;
|
||||
peep_window_state_update(peep);
|
||||
|
||||
peep->next_in_queue = 0xFFFF;
|
||||
peep->next_in_queue = SPRITE_INDEX_NULL;
|
||||
|
||||
ride->queue_length[peep->current_ride_station]++;
|
||||
|
||||
uint16 current_last = ride->last_peep_in_queue[peep->current_ride_station];
|
||||
if (current_last == 0xFFFF){
|
||||
if (current_last == SPRITE_INDEX_NULL) {
|
||||
ride->last_peep_in_queue[peep->current_ride_station] = peep->sprite_index;
|
||||
return;
|
||||
}
|
||||
|
||||
rct_peep* queue_peep;
|
||||
for (queue_peep = GET_PEEP(current_last);
|
||||
queue_peep->next_in_queue != 0xFFFF;
|
||||
queue_peep->next_in_queue != SPRITE_INDEX_NULL;
|
||||
queue_peep = GET_PEEP(queue_peep->next_in_queue));
|
||||
|
||||
queue_peep->next_in_queue = peep->sprite_index;
|
||||
@@ -3038,7 +3038,7 @@ static void peep_update_ride_sub_state_2(rct_peep* peep){
|
||||
|
||||
|
||||
for (int i = 0; i < ride->num_vehicles; ++i){
|
||||
if (ride->vehicles[i] == 0xFFFF)
|
||||
if (ride->vehicles[i] == SPRITE_INDEX_NULL)
|
||||
continue;
|
||||
|
||||
rct_vehicle* train = GET_VEHICLE(ride->vehicles[i]);
|
||||
@@ -3090,7 +3090,7 @@ static void peep_update_ride_sub_state_2(rct_peep* peep){
|
||||
}
|
||||
|
||||
vehicle->next_free_seat--;
|
||||
vehicle->peep[peep->current_seat] = 0xFFFF;
|
||||
vehicle->peep[peep->current_seat] = SPRITE_INDEX_NULL;
|
||||
|
||||
peep_update_ride_sub_state_2_rejoin_queue(peep, ride);
|
||||
}
|
||||
@@ -4890,7 +4890,7 @@ static void peep_update_queuing(rct_peep* peep){
|
||||
|
||||
if (peep->sub_state != 10){
|
||||
bool is_front = true;
|
||||
if (peep->next_in_queue != 0xFFFF) {
|
||||
if (peep->next_in_queue != SPRITE_INDEX_NULL) {
|
||||
// Fix #4819: Occasionally the peep->next_in_queue is incorrectly set
|
||||
// to prevent this from causing the peeps to enter a loop
|
||||
// first check if the next in queue is actually nearby
|
||||
@@ -6305,7 +6305,7 @@ static int peep_update_patrolling_find_sweeping(rct_peep* peep){
|
||||
uint16 sprite_id = sprite_get_first_in_quadrant(peep->x, peep->y);
|
||||
|
||||
for (rct_sprite* sprite = NULL;
|
||||
sprite_id != 0xFFFF;
|
||||
sprite_id != SPRITE_INDEX_NULL;
|
||||
sprite_id = sprite->unknown.next_in_quadrant){
|
||||
|
||||
sprite = get_sprite(sprite_id);
|
||||
@@ -7906,7 +7906,7 @@ void sub_693BAB(rct_peep* peep) {
|
||||
*/
|
||||
static int peep_update_queue_position(rct_peep* peep){
|
||||
peep->time_in_queue++;
|
||||
if (peep->next_in_queue == 0xFFFF)
|
||||
if (peep->next_in_queue == SPRITE_INDEX_NULL)
|
||||
return 0;
|
||||
|
||||
rct_peep* peep_next = GET_PEEP(peep->next_in_queue);
|
||||
@@ -8257,7 +8257,7 @@ static int peep_footpath_move_forward(rct_peep* peep, sint16 x, sint16 y, rct_ma
|
||||
uint8 litter_count = 0;
|
||||
uint8 sick_count = 0;
|
||||
uint16 sprite_id = sprite_get_first_in_quadrant(x, y);
|
||||
for (rct_sprite* sprite; sprite_id != 0xFFFF; sprite_id = sprite->unknown.next_in_quadrant){
|
||||
for (rct_sprite* sprite; sprite_id != SPRITE_INDEX_NULL; sprite_id = sprite->unknown.next_in_quadrant){
|
||||
sprite = get_sprite(sprite_id);
|
||||
if (sprite->unknown.sprite_identifier == SPRITE_IDENTIFIER_PEEP){
|
||||
rct_peep* other_peep = (rct_peep*)sprite;
|
||||
|
||||
@@ -519,7 +519,7 @@ uint16 hire_new_staff_member(uint8 staffType)
|
||||
int result = game_do_command_p(GAME_COMMAND_HIRE_NEW_STAFF_MEMBER, &command_x, &ebx, &command_y, &command_z, &esi, &new_sprite_index, &ebp);
|
||||
|
||||
if (result == MONEY32_UNDEFINED)
|
||||
return 0xFFFF;
|
||||
return SPRITE_INDEX_NULL;
|
||||
|
||||
return new_sprite_index;
|
||||
}
|
||||
|
||||
@@ -596,7 +596,7 @@ private:
|
||||
dst->entrances[i] = src->entrance[i];
|
||||
dst->exits[i] = src->exit[i];
|
||||
dst->queue_time[i] = src->queue_time[i];
|
||||
dst->last_peep_in_queue[i] = 0xFFFF;
|
||||
dst->last_peep_in_queue[i] = SPRITE_INDEX_NULL;
|
||||
dst->queue_length[i] = src->num_peeps_in_queue[i];
|
||||
}
|
||||
dst->num_stations = src->num_stations;
|
||||
|
||||
@@ -456,7 +456,7 @@ int cable_lift_update_track_motion(rct_vehicle *cableLift)
|
||||
}
|
||||
vehicle->acceleration /= _vehicleUnkF64E10;
|
||||
if (_vehicleVelocityF64E08 >= 0) {
|
||||
if (vehicle->next_vehicle_on_train == 0xFFFF)
|
||||
if (vehicle->next_vehicle_on_train == SPRITE_INDEX_NULL)
|
||||
break;
|
||||
vehicle = GET_VEHICLE(vehicle->next_vehicle_on_train);
|
||||
}
|
||||
@@ -471,7 +471,7 @@ int cable_lift_update_track_motion(rct_vehicle *cableLift)
|
||||
uint16 frictionTotal = 0;
|
||||
sint32 var2CTotal = 0;
|
||||
|
||||
for (uint16 spriteId = cableLift->sprite_index; spriteId != 0xFFFF;) {
|
||||
for (uint16 spriteId = cableLift->sprite_index; spriteId != SPRITE_INDEX_NULL;) {
|
||||
rct_vehicle* vehicle = GET_VEHICLE(spriteId);
|
||||
vehicleCount++;
|
||||
frictionTotal += vehicle->friction;
|
||||
|
||||
@@ -845,7 +845,7 @@ void ride_get_status(int rideIndex, rct_string_id *formatSecondary, int *argumen
|
||||
*formatSecondary = STR_TEST_RUN;
|
||||
return;
|
||||
}
|
||||
if (ride->mode == RIDE_MODE_RACE && !(ride->lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) && ride->race_winner != 0xFFFF && (GET_PEEP(ride->race_winner))->sprite_identifier == SPRITE_IDENTIFIER_PEEP) {
|
||||
if (ride->mode == RIDE_MODE_RACE && !(ride->lifecycle_flags & RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING) && ride->race_winner != SPRITE_INDEX_NULL && (GET_PEEP(ride->race_winner))->sprite_identifier == SPRITE_IDENTIFIER_PEEP) {
|
||||
rct_peep *peep = GET_PEEP(ride->race_winner);
|
||||
if (peep->name_string_idx == STR_GUEST_X) {
|
||||
*argument = peep->id;
|
||||
@@ -2422,7 +2422,7 @@ void ride_prepare_breakdown(int rideIndex, int breakdownReason)
|
||||
// Set flag on broken car
|
||||
vehicle = GET_VEHICLE(ride->vehicles[ride->broken_vehicle]);
|
||||
for (i = ride->broken_car; i > 0; i--) {
|
||||
if (vehicle->next_vehicle_on_train == (uint16)0xFFFFFFFF) {
|
||||
if (vehicle->next_vehicle_on_train == SPRITE_INDEX_NULL) {
|
||||
vehicle = NULL;
|
||||
break;
|
||||
}
|
||||
@@ -5487,7 +5487,7 @@ void game_command_set_ride_status(int *eax, int *ebx, int *ecx, int *edx, int *e
|
||||
|
||||
ride->status = RIDE_STATUS_CLOSED;
|
||||
ride->lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING;
|
||||
ride->race_winner = 0xFFFF;
|
||||
ride->race_winner = SPRITE_INDEX_NULL;
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST;
|
||||
window_invalidate_by_number(WC_RIDE, rideIndex);
|
||||
}
|
||||
@@ -5521,7 +5521,7 @@ void game_command_set_ride_status(int *eax, int *ebx, int *ecx, int *edx, int *e
|
||||
}
|
||||
|
||||
if (*ebx & GAME_COMMAND_FLAG_APPLY) {
|
||||
ride->race_winner = 0xFFFF;
|
||||
ride->race_winner = SPRITE_INDEX_NULL;
|
||||
ride->status = targetStatus;
|
||||
ride_get_measurement(rideIndex, NULL);
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST;
|
||||
@@ -6043,7 +6043,7 @@ foundRideEntry:
|
||||
}
|
||||
|
||||
for (int i = 0; i < 32; i++) {
|
||||
ride->vehicles[i] = 0xFFFF;
|
||||
ride->vehicles[i] = SPRITE_INDEX_NULL;
|
||||
}
|
||||
|
||||
ride->status = RIDE_STATUS_CLOSED;
|
||||
@@ -8298,7 +8298,7 @@ static money32 place_ride_entrance_or_exit(sint16 x, sint16 y, sint16 z, uint8 d
|
||||
ride->exits[station_num] = (x / 32) | (y / 32 << 8);
|
||||
} else {
|
||||
ride->entrances[station_num] = (x / 32) | (y / 32 << 8);
|
||||
ride->last_peep_in_queue[station_num] = 0xFFFF;
|
||||
ride->last_peep_in_queue[station_num] = SPRITE_INDEX_NULL;
|
||||
ride->queue_length[station_num] = 0;
|
||||
|
||||
map_animation_create(MAP_ANIMATION_TYPE_RIDE_ENTRANCE, x, y, z / 8);
|
||||
@@ -8646,7 +8646,7 @@ uint32 ride_customers_in_last_5_minutes(const rct_ride *ride) {
|
||||
rct_vehicle *ride_get_broken_vehicle(rct_ride *ride) {
|
||||
uint16 vehicleIndex = ride->vehicles[ride->broken_vehicle];
|
||||
|
||||
if (vehicleIndex == 0xFFFF) {
|
||||
if (vehicleIndex == SPRITE_INDEX_NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
+24
-24
@@ -1106,7 +1106,7 @@ static int vehicle_close_restraints(rct_vehicle* vehicle){
|
||||
}
|
||||
vehicle_invalidate(vehicle);
|
||||
ebp++;
|
||||
} while ((vehicle_id = vehicle->next_vehicle_on_train) != 0xFFFF);
|
||||
} while ((vehicle_id = vehicle->next_vehicle_on_train) != SPRITE_INDEX_NULL);
|
||||
|
||||
return ebp;
|
||||
}
|
||||
@@ -1205,7 +1205,7 @@ static int vehicle_open_restraints(rct_vehicle* vehicle){
|
||||
}
|
||||
vehicle_invalidate(vehicle);
|
||||
ebp++;
|
||||
} while ((vehicle_id = vehicle->next_vehicle_on_train) != 0xFFFF);
|
||||
} while ((vehicle_id = vehicle->next_vehicle_on_train) != SPRITE_INDEX_NULL);
|
||||
|
||||
return ebp;
|
||||
}
|
||||
@@ -1799,7 +1799,7 @@ static void train_ready_to_depart(rct_vehicle* vehicle, uint8 num_peeps_on_train
|
||||
ride->mode == RIDE_MODE_BACKWARD_ROTATION){
|
||||
|
||||
uint8 peep = ((-vehicle->vehicle_sprite_type) / 8) & 0xF;
|
||||
if (vehicle->peep[peep] != 0xFFFF){
|
||||
if (vehicle->peep[peep] != SPRITE_INDEX_NULL) {
|
||||
ride->train_at_station[vehicle->current_station] = 0xFF;
|
||||
vehicle->status = VEHICLE_STATUS_UNLOADING_PASSENGERS;
|
||||
vehicle->sub_state = 0;
|
||||
@@ -1865,7 +1865,7 @@ static void vehicle_update_waiting_for_passengers(rct_vehicle* vehicle){
|
||||
// 0xF64E31, 0xF64E32, 0xF64E33
|
||||
uint8 num_peeps_on_train = 0, num_used_seats_on_train = 0, num_seats_on_train = 0;
|
||||
|
||||
for (uint16 sprite_id = vehicle->sprite_index; sprite_id != 0xFFFF;){
|
||||
for (uint16 sprite_id = vehicle->sprite_index; sprite_id != SPRITE_INDEX_NULL;) {
|
||||
rct_vehicle* train_vehicle = GET_VEHICLE(sprite_id);
|
||||
|
||||
num_peeps_on_train += train_vehicle->num_peeps;
|
||||
@@ -1910,7 +1910,7 @@ static void vehicle_update_waiting_for_passengers(rct_vehicle* vehicle){
|
||||
|
||||
for (int i = 0; i < 32; ++i){
|
||||
uint16 train_id = ride->vehicles[i];
|
||||
if (train_id == 0xFFFF)
|
||||
if (train_id == SPRITE_INDEX_NULL)
|
||||
continue;
|
||||
|
||||
if (train_id == vehicle->sprite_index)
|
||||
@@ -2063,7 +2063,7 @@ static void vehicle_update_waiting_to_depart(rct_vehicle* vehicle) {
|
||||
if (ride->mode == RIDE_MODE_FORWARD_ROTATION ||
|
||||
ride->mode == RIDE_MODE_BACKWARD_ROTATION) {
|
||||
uint8 seat = ((-vehicle->vehicle_sprite_type) >> 3) & 0xF;
|
||||
if (vehicle->peep[seat * 2] == 0xFFFF) {
|
||||
if (vehicle->peep[seat * 2] == SPRITE_INDEX_NULL) {
|
||||
if (vehicle->num_peeps == 0) {
|
||||
skipCheck = true;
|
||||
}
|
||||
@@ -2079,7 +2079,7 @@ static void vehicle_update_waiting_to_depart(rct_vehicle* vehicle) {
|
||||
}
|
||||
else {
|
||||
uint16 spriteId = vehicle->sprite_index;
|
||||
for (rct_vehicle* curVehicle; spriteId != 0xFFFF; spriteId = curVehicle->next_vehicle_on_train) {
|
||||
for (rct_vehicle* curVehicle; spriteId != SPRITE_INDEX_NULL; spriteId = curVehicle->next_vehicle_on_train) {
|
||||
curVehicle = GET_VEHICLE(spriteId);
|
||||
|
||||
if (curVehicle->num_peeps != 0) {
|
||||
@@ -2515,7 +2515,7 @@ void vehicle_peep_easteregg_here_we_are(rct_vehicle* vehicle) {
|
||||
peep_insert_new_thought(peep, PEEP_THOUGHT_TYPE_HERE_WE_ARE, peep->current_ride);
|
||||
}
|
||||
}
|
||||
} while ((spriteId = vehicle->next_vehicle_on_train) != 0xFFFF);
|
||||
} while ((spriteId = vehicle->next_vehicle_on_train) != SPRITE_INDEX_NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2998,7 +2998,7 @@ static void vehicle_update_collision_setup(rct_vehicle* vehicle) {
|
||||
|
||||
rct_vehicle* lastVehicle = vehicle;
|
||||
uint16 spriteId = vehicle->sprite_index;
|
||||
for (rct_vehicle* train; spriteId != 0xFFFF; spriteId = train->next_vehicle_on_train) {
|
||||
for (rct_vehicle* train; spriteId != SPRITE_INDEX_NULL; spriteId = train->next_vehicle_on_train) {
|
||||
train = GET_VEHICLE(spriteId);
|
||||
lastVehicle = train;
|
||||
|
||||
@@ -3088,7 +3088,7 @@ static void vehicle_update_crash_setup(rct_vehicle* vehicle) {
|
||||
|
||||
rct_vehicle* lastVehicle = vehicle;
|
||||
uint16 spriteId = vehicle->sprite_index;
|
||||
for (rct_vehicle* trainVehicle; spriteId != 0xFFFF; spriteId = trainVehicle->next_vehicle_on_train) {
|
||||
for (rct_vehicle* trainVehicle; spriteId != SPRITE_INDEX_NULL; spriteId = trainVehicle->next_vehicle_on_train) {
|
||||
trainVehicle = GET_VEHICLE(spriteId);
|
||||
lastVehicle = trainVehicle;
|
||||
|
||||
@@ -3519,11 +3519,11 @@ static void vehicle_update_unloading_passengers(rct_vehicle* vehicle) {
|
||||
ride->mode == RIDE_MODE_BACKWARD_ROTATION) {
|
||||
uint8 seat = ((-vehicle->vehicle_sprite_type) >> 3) & 0xF;
|
||||
if (vehicle->restraints_position == 255 &&
|
||||
(vehicle->peep[seat * 2] != 0xFFFF)) {
|
||||
(vehicle->peep[seat * 2] != SPRITE_INDEX_NULL)) {
|
||||
vehicle->next_free_seat -= 2;
|
||||
|
||||
rct_peep* peep = GET_PEEP(vehicle->peep[seat * 2]);
|
||||
vehicle->peep[seat * 2] = 0xFFFF;
|
||||
vehicle->peep[seat * 2] = SPRITE_INDEX_NULL;
|
||||
|
||||
peep_decrement_num_riders(peep);
|
||||
peep->sub_state = 7;
|
||||
@@ -3531,7 +3531,7 @@ static void vehicle_update_unloading_passengers(rct_vehicle* vehicle) {
|
||||
peep_window_state_update(peep);
|
||||
|
||||
peep = GET_PEEP(vehicle->peep[seat * 2 + 1]);
|
||||
vehicle->peep[seat * 2 + 1] = 0xFFFF;
|
||||
vehicle->peep[seat * 2 + 1] = SPRITE_INDEX_NULL;
|
||||
|
||||
peep_decrement_num_riders(peep);
|
||||
peep->sub_state = 7;
|
||||
@@ -3556,7 +3556,7 @@ static void vehicle_update_unloading_passengers(rct_vehicle* vehicle) {
|
||||
}
|
||||
|
||||
uint16 spriteId = vehicle->sprite_index;
|
||||
for (rct_vehicle* train; spriteId != 0xFFFF; spriteId = train->next_vehicle_on_train) {
|
||||
for (rct_vehicle* train; spriteId != SPRITE_INDEX_NULL; spriteId = train->next_vehicle_on_train) {
|
||||
train = GET_VEHICLE(spriteId);
|
||||
if (train->restraints_position != 255)
|
||||
continue;
|
||||
@@ -3579,7 +3579,7 @@ static void vehicle_update_unloading_passengers(rct_vehicle* vehicle) {
|
||||
return;
|
||||
|
||||
uint16 spriteId = vehicle->sprite_index;
|
||||
for (rct_vehicle* train; spriteId != 0xFFFF; spriteId = train->next_vehicle_on_train) {
|
||||
for (rct_vehicle* train; spriteId != SPRITE_INDEX_NULL; spriteId = train->next_vehicle_on_train) {
|
||||
train = GET_VEHICLE(spriteId);
|
||||
if (train->num_peeps != train->next_free_seat)
|
||||
return;
|
||||
@@ -4532,7 +4532,7 @@ static void vehicle_kill_all_passengers(rct_vehicle* vehicle) {
|
||||
uint16 numFatalities = 0;
|
||||
|
||||
uint16 spriteId = vehicle->sprite_index;
|
||||
for (rct_vehicle* curVehicle; spriteId != 0xFFFF; spriteId = curVehicle->next_vehicle_on_train) {
|
||||
for (rct_vehicle* curVehicle; spriteId != SPRITE_INDEX_NULL; spriteId = curVehicle->next_vehicle_on_train) {
|
||||
curVehicle = GET_VEHICLE(spriteId);
|
||||
numFatalities += curVehicle->num_peeps;
|
||||
}
|
||||
@@ -4558,7 +4558,7 @@ static void vehicle_kill_all_passengers(rct_vehicle* vehicle) {
|
||||
}
|
||||
|
||||
spriteId = vehicle->sprite_index;
|
||||
for (rct_vehicle* curVehicle; spriteId != 0xFFFF; spriteId = curVehicle->next_vehicle_on_train) {
|
||||
for (rct_vehicle* curVehicle; spriteId != SPRITE_INDEX_NULL; spriteId = curVehicle->next_vehicle_on_train) {
|
||||
curVehicle = GET_VEHICLE(spriteId);
|
||||
|
||||
if (curVehicle->num_peeps != curVehicle->next_free_seat)
|
||||
@@ -4770,7 +4770,7 @@ static void vehicle_update_crash(rct_vehicle *vehicle){
|
||||
if (curVehicle->sub_state == 1) {
|
||||
curVehicle->var_4E += 0xFFEC;
|
||||
}
|
||||
} while ((spriteId = curVehicle->next_vehicle_on_train) != 0xFFFF);
|
||||
} while ((spriteId = curVehicle->next_vehicle_on_train) != SPRITE_INDEX_NULL);
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -5723,7 +5723,7 @@ bool vehicle_update_bumper_car_collision(rct_vehicle *vehicle, sint16 x, sint16
|
||||
x + bp > rideRight ||
|
||||
y + bp > rideBottom) {
|
||||
if (spriteId != NULL)
|
||||
*spriteId = 0xFFFF;
|
||||
*spriteId = SPRITE_INDEX_NULL;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -5736,7 +5736,7 @@ bool vehicle_update_bumper_car_collision(rct_vehicle *vehicle, sint16 x, sint16
|
||||
location.y += Unk9A37C4[i].y;
|
||||
|
||||
uint16 spriteIdx = sprite_get_first_in_quadrant(location.x * 32, location.y * 32);
|
||||
while (spriteIdx != 0xFFFF) {
|
||||
while (spriteIdx != SPRITE_INDEX_NULL) {
|
||||
rct_vehicle* vehicle2 = GET_VEHICLE(spriteIdx);
|
||||
spriteIdx = vehicle2->next_in_quadrant;
|
||||
|
||||
@@ -7041,14 +7041,14 @@ static bool vehicle_update_motion_collision_detection(
|
||||
rct_xy8 location = {.x = (x / 32), .y = (y / 32)};
|
||||
|
||||
bool mayCollide = false;
|
||||
uint16 collideId = 0xFFFF;
|
||||
uint16 collideId = SPRITE_INDEX_NULL;
|
||||
rct_vehicle* collideVehicle = NULL;
|
||||
for (int i = 0; i < countof(Unk9A37C4); i++) {
|
||||
location.x += Unk9A37C4[i].x;
|
||||
location.y += Unk9A37C4[i].y;
|
||||
|
||||
collideId = sprite_get_first_in_quadrant(location.x * 32, location.y * 32);
|
||||
for(; collideId != 0xFFFF; collideId = collideVehicle->next_in_quadrant){
|
||||
for(; collideId != SPRITE_INDEX_NULL; collideId = collideVehicle->next_in_quadrant){
|
||||
collideVehicle = GET_VEHICLE(collideId);
|
||||
if (collideVehicle == vehicle) continue;
|
||||
|
||||
@@ -8163,7 +8163,7 @@ loc_6DC743:
|
||||
// When the ride is closed occasionally the peep is removed
|
||||
// but the vehicle is still on the track. This will prevent
|
||||
// it from crashing in that situation.
|
||||
if (vehicle->peep[0] != 0xFFFF) {
|
||||
if (vehicle->peep[0] != SPRITE_INDEX_NULL) {
|
||||
if (z == 2) {
|
||||
rct_peep *peep = GET_PEEP(vehicle->peep[0]);
|
||||
if (peep->id & 7) {
|
||||
@@ -8612,7 +8612,7 @@ int vehicle_update_track_motion(rct_vehicle *vehicle, int *outStation)
|
||||
_vehicleFrontVehicle = vehicle;
|
||||
|
||||
uint16 spriteId = vehicle->sprite_index;
|
||||
while (spriteId != 0xFFFF) {
|
||||
while (spriteId != SPRITE_INDEX_NULL) {
|
||||
rct_vehicle* car = GET_VEHICLE(spriteId);
|
||||
vehicleEntry = vehicle_get_vehicle_entry(car);
|
||||
|
||||
|
||||
@@ -2296,7 +2296,7 @@ static void window_ride_main_update(rct_window *w)
|
||||
if (w->ride.view <= ride->num_vehicles) {
|
||||
int vehicleIndex = w->ride.view - 1;
|
||||
uint16 vehicleSpriteIndex = ride->vehicles[vehicleIndex];
|
||||
if (vehicleSpriteIndex == 0xFFFF)
|
||||
if (vehicleSpriteIndex == SPRITE_INDEX_NULL)
|
||||
return;
|
||||
|
||||
rct_vehicle *vehicle = &(get_sprite(vehicleSpriteIndex)->vehicle);
|
||||
@@ -2490,7 +2490,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window *w, void *argumen
|
||||
|
||||
vehicleIndex = w->ride.view - 1;
|
||||
vehicleSpriteIndex = ride->vehicles[vehicleIndex];
|
||||
if (vehicleSpriteIndex == 0xFFFF)
|
||||
if (vehicleSpriteIndex == SPRITE_INDEX_NULL)
|
||||
return 0;
|
||||
|
||||
vehicle = &(get_sprite(vehicleSpriteIndex)->vehicle);
|
||||
|
||||
@@ -197,7 +197,7 @@ static bool map_animation_invalidate_small_scenery(int x, int y, int baseZ)
|
||||
int y2 = y - TileDirectionDelta[direction].y;
|
||||
|
||||
uint16 spriteIdx = sprite_get_first_in_quadrant(x2, y2);
|
||||
for (; spriteIdx != 0xFFFF; spriteIdx = sprite->unknown.next_in_quadrant) {
|
||||
for (; spriteIdx != SPRITE_INDEX_NULL; spriteIdx = sprite->unknown.next_in_quadrant) {
|
||||
sprite = get_sprite(spriteIdx);
|
||||
if (sprite->unknown.linked_list_type_offset != SPRITE_LIST_PEEP * 2)
|
||||
continue;
|
||||
|
||||
Reference in new issue
Block a user