mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #728 bug caused by accessing map_elements below -1
This commit is contained in:
parent
36971b29cb
commit
9a976b4d40
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue