From b023d1a9aca78137c81999e00ceedf85d9bccf02 Mon Sep 17 00:00:00 2001 From: duncanspumpkin Date: Sun, 10 Apr 2016 08:21:36 +0100 Subject: [PATCH] Fix #3267. Two bugs fixed grass length detected and activity timeout. The grass length detection had been simplified but failed to account for the upper bits being used as none graphical grass length changes. This caused mown grass to be detected as unmown. Most staff functions have an activity timeout to prevent them from repeatedly doing activities in the exact same location. Mown grass did not have this timeout reset in the original game. The reset has now been removed. --- src/peep/peep.c | 3 +-- src/peep/staff.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/peep/peep.c b/src/peep/peep.c index 09cd1d3e80..620d710c43 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -4134,7 +4134,6 @@ static void peep_update_queuing(rct_peep* peep){ * rct2: 0x006BF567 */ static void peep_update_mowing(rct_peep* peep){ - peep->var_E2 = 0; if (!checkForPath(peep))return; invalidate_sprite_2((rct_sprite*)peep); @@ -5321,7 +5320,7 @@ static int peep_update_patrolling_find_grass(rct_peep* peep){ if ((map_element->properties.surface.terrain & MAP_ELEMENT_SURFACE_TERRAIN_MASK) != TERRAIN_GRASS) return 0; - if (map_element->properties.surface.grass_length < GRASS_LENGTH_CLEAR_1) + if ((map_element->properties.surface.grass_length & 0x7) < GRASS_LENGTH_CLEAR_1) return 0; peep_decrement_num_riders(peep); diff --git a/src/peep/staff.c b/src/peep/staff.c index b5019b23df..16f36389c2 100644 --- a/src/peep/staff.c +++ b/src/peep/staff.c @@ -691,7 +691,7 @@ static uint8 staff_handyman_direction_to_uncut_grass(rct_peep* peep, uint8 valid if (abs(mapElement->base_height - peep->next_z) > 2) continue; - if (!(mapElement->properties.surface.grass_length & GRASS_LENGTH_CLUMPS_2)) + if ((mapElement->properties.surface.grass_length & 0x7) < GRASS_LENGTH_CLEAR_1) continue; return chosenDirection;