Fix mechanics prioritising inspecting over fixing

This commit is contained in:
Duncan Frost 2015-04-02 18:47:01 +01:00
parent 2a463b9909
commit 393e011993
2 changed files with 11 additions and 5 deletions

View File

@ -44,7 +44,9 @@ enum STAFF_ORDERS{
STAFF_ORDERS_SWEEPING = (1 << 0),
STAFF_ORDERS_WATER_FLOWERS = (1 << 1),
STAFF_ORDERS_EMPTY_BINS = (1 << 2),
STAFF_ORDERS_MOWING = (1 << 3)
STAFF_ORDERS_MOWING = (1 << 3),
STAFF_ORDERS_INSPECT_RIDES = (1 << 0),
STAFF_ORDERS_FIX_RIDES = (1 << 1)
};
void game_command_update_staff_colour(int *eax, int *ebx, int *ecx, int *edx, int *esi, int *edi, int *ebp);

View File

@ -1714,14 +1714,18 @@ rct_peep *find_closest_mechanic(int x, int y, int forInspection)
if (peep->staff_type != STAFF_TYPE_MECHANIC)
continue;
if (forInspection) {
if ((peep->state == PEEP_STATE_HEADING_TO_INSPECTION && peep->sub_state >= 4) && peep->state != PEEP_STATE_PATROLLING)
if (!forInspection) {
if (peep->state == PEEP_STATE_HEADING_TO_INSPECTION){
if (peep->sub_state >= 4)
continue;
}
else if (peep->state != PEEP_STATE_PATROLLING)
continue;
if (!(peep->staff_orders & 2))
if (!(peep->staff_orders & STAFF_ORDERS_FIX_RIDES))
continue;
} else {
if (peep->state != PEEP_STATE_PATROLLING || !(peep->staff_orders & 1))
if (peep->state != PEEP_STATE_PATROLLING || !(peep->staff_orders & STAFF_ORDERS_INSPECT_RIDES))
continue;
}