Fix #728 bug caused by accessing map_elements below -1

This commit is contained in:
Duncan Frost 2015-01-29 17:41:09 +00:00
parent 36971b29cb
commit 9a976b4d40
1 changed files with 2 additions and 2 deletions

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 {