1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Optimize peep functions

This commit is contained in:
Daniël Heres
2015-10-20 17:35:31 +02:00
parent 4f4f434c5a
commit 5c611dc600

View File

@@ -8612,8 +8612,8 @@ static void peep_pick_ride_to_go_on(rct_peep *peep)
// Take nearby rides into consideration
int cx = floor2(peep->x, 32);
int cy = floor2(peep->y, 32);
for (int x = cx - 320; x <= cx + 320; x++) {
for (int y = cy - 320; y <= cy + 320; y++) {
for (int x = cx - 320; x <= cx + 320; x += 32) {
for (int y = cy - 320; y <= cy + 320; y += 32) {
if (x >= 0 && y >= 0 && x < (256 * 32) && y < (256 * 32)) {
rct_map_element *mapElement = map_get_first_element_at(x >> 5, y >> 5);
do {
@@ -8728,8 +8728,8 @@ static void peep_head_for_nearest_ride_type(rct_peep *peep, int rideType)
// Take nearby rides into consideration
int cx = floor2(peep->x, 32);
int cy = floor2(peep->y, 32);
for (int x = cx - 320; x <= cx + 320; x++) {
for (int y = cy - 320; y <= cy + 320; y++) {
for (int x = cx - 320; x <= cx + 320; x += 32) {
for (int y = cy - 320; y <= cy + 320; y += 32) {
if (x >= 0 && y >= 0 && x < (256 * 32) && y < (256 * 32)) {
rct_map_element *mapElement = map_get_first_element_at(x >> 5, y >> 5);
do {
@@ -8840,8 +8840,8 @@ static void peep_head_for_nearest_ride_with_flags(rct_peep *peep, int rideTypeFl
// Take nearby rides into consideration
int cx = floor2(peep->x, 32);
int cy = floor2(peep->y, 32);
for (int x = cx - 320; x <= cx + 320; x++) {
for (int y = cy - 320; y <= cy + 320; y++) {
for (int x = cx - 320; x <= cx + 320; x += 32) {
for (int y = cy - 320; y <= cy + 320; y += 32) {
if (x >= 0 && y >= 0 && x < (256 * 32) && y < (256 * 32)) {
rct_map_element *mapElement = map_get_first_element_at(x >> 5, y >> 5);
do {