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

Merge branch 'develop' into set-ride-status

This commit is contained in:
IntelOrca
2015-01-29 19:01:54 +00:00
3 changed files with 8 additions and 2 deletions

View File

@@ -247,6 +247,7 @@ money32 ride_calculate_income_per_hour(rct_ride *ride)
shopItem = entry->shop_item_secondary;
if (shopItem != 255) {
priceMinusCost += ride->price_secondary;
priceMinusCost -= get_shop_item_cost(shopItem);
priceMinusCost /= 2;
}

View File

@@ -733,8 +733,8 @@ static int ride_ratings_get_scenery_score(rct_ride *ride)
// Count surrounding scenery items
numSceneryItems = 0;
for (yy = y - 5; yy <= y + 5; yy++) {
for (xx = x - 5; xx <= x + 5; xx++) {
for (yy = max(y - 5, 0); yy <= y + 5; yy++) {
for (xx = max(x - 5, 0); xx <= x + 5; xx++) {
// Count scenery items on this tile
mapElement = map_get_first_element_at(xx, yy);
do {

View File

@@ -88,6 +88,11 @@ void map_element_iterator_restart_for_tile(map_element_iterator *it)
rct_map_element *map_get_first_element_at(int x, int y)
{
if (x < 0 || y < 0 || x > 255 || y > 255)
{
log_error("Trying to access element outside of range");
return NULL;
}
return TILE_MAP_ELEMENT_POINTER(x + y * 256);
}