mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #11853 from tupaschoal/prevent-shadow-peep-3
Rename some Peep member variables to use TitleCase
This commit is contained in:
commit
6312b27fa7
|
@ -724,7 +724,7 @@ void window_guest_overview_mouse_up(rct_window* w, rct_widgetindex widgetIndex)
|
||||||
break;
|
break;
|
||||||
case WIDX_TRACK:
|
case WIDX_TRACK:
|
||||||
{
|
{
|
||||||
uint32_t flags = peep->peep_flags ^ PEEP_FLAGS_TRACKING;
|
uint32_t flags = peep->PeepFlags ^ PEEP_FLAGS_TRACKING;
|
||||||
|
|
||||||
auto guestSetFlagsAction = GuestSetFlagsAction(w->number, flags);
|
auto guestSetFlagsAction = GuestSetFlagsAction(w->number, flags);
|
||||||
GameActions::Execute(&guestSetFlagsAction);
|
GameActions::Execute(&guestSetFlagsAction);
|
||||||
|
@ -1136,7 +1136,7 @@ void window_guest_overview_invalidate(rct_window* w)
|
||||||
|
|
||||||
auto peep = GET_PEEP(w->number);
|
auto peep = GET_PEEP(w->number);
|
||||||
w->pressed_widgets &= ~(1 << WIDX_TRACK);
|
w->pressed_widgets &= ~(1 << WIDX_TRACK);
|
||||||
if (peep->peep_flags & PEEP_FLAGS_TRACKING)
|
if (peep->PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
{
|
{
|
||||||
w->pressed_widgets |= (1 << WIDX_TRACK);
|
w->pressed_widgets |= (1 << WIDX_TRACK);
|
||||||
}
|
}
|
||||||
|
@ -1947,7 +1947,7 @@ static rct_string_id window_guest_inventory_format_item(Peep* peep, int32_t item
|
||||||
set_format_arg(0, uint32_t, SPRITE_ID_PALETTE_COLOUR_1(peep->BalloonColour) | ShopItems[item].Image);
|
set_format_arg(0, uint32_t, SPRITE_ID_PALETTE_COLOUR_1(peep->BalloonColour) | ShopItems[item].Image);
|
||||||
break;
|
break;
|
||||||
case SHOP_ITEM_PHOTO:
|
case SHOP_ITEM_PHOTO:
|
||||||
ride = get_ride(peep->photo1_ride_ref);
|
ride = get_ride(peep->Photo1RideRef);
|
||||||
if (ride != nullptr)
|
if (ride != nullptr)
|
||||||
ride->FormatNameTo(gCommonFormatArgs + 6);
|
ride->FormatNameTo(gCommonFormatArgs + 6);
|
||||||
break;
|
break;
|
||||||
|
@ -2115,7 +2115,7 @@ void window_guest_debug_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
}
|
}
|
||||||
screenCoords.y += LIST_ROW_HEIGHT;
|
screenCoords.y += LIST_ROW_HEIGHT;
|
||||||
{
|
{
|
||||||
int32_t args[] = { peep->pathfind_goal.x, peep->pathfind_goal.y, peep->pathfind_goal.z, peep->pathfind_goal.direction };
|
int32_t args[] = { peep->PathfindGoal.x, peep->PathfindGoal.y, peep->PathfindGoal.z, peep->PathfindGoal.direction };
|
||||||
gfx_draw_string_left(dpi, STR_PEEP_DEBUG_PATHFIND_GOAL, args, 0, screenCoords.x, screenCoords.y);
|
gfx_draw_string_left(dpi, STR_PEEP_DEBUG_PATHFIND_GOAL, args, 0, screenCoords.x, screenCoords.y);
|
||||||
}
|
}
|
||||||
screenCoords.y += LIST_ROW_HEIGHT;
|
screenCoords.y += LIST_ROW_HEIGHT;
|
||||||
|
@ -2123,7 +2123,7 @@ void window_guest_debug_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
screenCoords.y += LIST_ROW_HEIGHT;
|
screenCoords.y += LIST_ROW_HEIGHT;
|
||||||
|
|
||||||
screenCoords.x += 10;
|
screenCoords.x += 10;
|
||||||
for (auto& point : peep->pathfind_history)
|
for (auto& point : peep->PathfindHistory)
|
||||||
{
|
{
|
||||||
int32_t args[] = { point.x, point.y, point.z, point.direction };
|
int32_t args[] = { point.x, point.y, point.z, point.direction };
|
||||||
gfx_draw_string_left(dpi, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, args, 0, screenCoords.x, screenCoords.y);
|
gfx_draw_string_left(dpi, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, args, 0, screenCoords.x, screenCoords.y);
|
||||||
|
|
|
@ -778,7 +778,7 @@ static void window_guest_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi,
|
||||||
gfx_draw_sprite(dpi, get_peep_face_sprite_small(peep), 118, y + 1, 0);
|
gfx_draw_sprite(dpi, get_peep_face_sprite_small(peep), 118, y + 1, 0);
|
||||||
|
|
||||||
// Tracking icon
|
// Tracking icon
|
||||||
if (peep->peep_flags & PEEP_FLAGS_TRACKING)
|
if (peep->PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
gfx_draw_sprite(dpi, STR_ENTER_SELECTION_SIZE, 112, y + 1, 0);
|
gfx_draw_sprite(dpi, STR_ENTER_SELECTION_SIZE, 112, y + 1, 0);
|
||||||
|
|
||||||
// Action
|
// Action
|
||||||
|
@ -1041,7 +1041,7 @@ static void window_guest_list_find_groups()
|
||||||
|
|
||||||
static bool guest_should_be_visible(Peep* peep)
|
static bool guest_should_be_visible(Peep* peep)
|
||||||
{
|
{
|
||||||
if (_window_guest_list_tracking_only && !(peep->peep_flags & PEEP_FLAGS_TRACKING))
|
if (_window_guest_list_tracking_only && !(peep->PeepFlags & PEEP_FLAGS_TRACKING))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (_window_guest_list_filter_name[0] != '\0')
|
if (_window_guest_list_filter_name[0] != '\0')
|
||||||
|
|
|
@ -570,7 +570,7 @@ void window_staff_overview_mousedown(rct_window* w, rct_widgetindex widgetIndex,
|
||||||
Peep* peep = GET_PEEP(w->number);
|
Peep* peep = GET_PEEP(w->number);
|
||||||
|
|
||||||
// Disable clear patrol area if no area is set.
|
// Disable clear patrol area if no area is set.
|
||||||
if (!(gStaffModes[peep->staff_id] & 2))
|
if (!(gStaffModes[peep->StaffId] & 2))
|
||||||
{
|
{
|
||||||
dropdown_set_disabled(1, true);
|
dropdown_set_disabled(1, true);
|
||||||
}
|
}
|
||||||
|
@ -593,9 +593,9 @@ void window_staff_overview_dropdown(rct_window* w, rct_widgetindex widgetIndex,
|
||||||
Peep* peep = GET_PEEP(w->number);
|
Peep* peep = GET_PEEP(w->number);
|
||||||
for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++)
|
for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++)
|
||||||
{
|
{
|
||||||
gStaffPatrolAreas[peep->staff_id * STAFF_PATROL_AREA_SIZE + i] = 0;
|
gStaffPatrolAreas[peep->StaffId * STAFF_PATROL_AREA_SIZE + i] = 0;
|
||||||
}
|
}
|
||||||
gStaffModes[peep->staff_id] &= ~2;
|
gStaffModes[peep->StaffId] &= ~2;
|
||||||
|
|
||||||
gfx_invalidate_screen();
|
gfx_invalidate_screen();
|
||||||
staff_update_greyed_patrol_areas();
|
staff_update_greyed_patrol_areas();
|
||||||
|
@ -635,7 +635,7 @@ static void window_staff_set_order(rct_window* w, int32_t order_id)
|
||||||
{
|
{
|
||||||
Peep* peep = GET_PEEP(w->number);
|
Peep* peep = GET_PEEP(w->number);
|
||||||
|
|
||||||
uint8_t newOrders = peep->staff_orders ^ (1 << order_id);
|
uint8_t newOrders = peep->StaffOrders ^ (1 << order_id);
|
||||||
auto staffSetOrdersAction = StaffSetOrdersAction(w->number, newOrders);
|
auto staffSetOrdersAction = StaffSetOrdersAction(w->number, newOrders);
|
||||||
GameActions::Execute(&staffSetOrdersAction);
|
GameActions::Execute(&staffSetOrdersAction);
|
||||||
}
|
}
|
||||||
|
@ -834,7 +834,7 @@ void window_staff_options_invalidate(rct_window* w)
|
||||||
window_staff_options_widgets[WIDX_COSTUME_BTN].type = WWT_EMPTY;
|
window_staff_options_widgets[WIDX_COSTUME_BTN].type = WWT_EMPTY;
|
||||||
w->pressed_widgets &= ~(
|
w->pressed_widgets &= ~(
|
||||||
(1 << WIDX_CHECKBOX_1) | (1 << WIDX_CHECKBOX_2) | (1 << WIDX_CHECKBOX_3) | (1 << WIDX_CHECKBOX_4));
|
(1 << WIDX_CHECKBOX_1) | (1 << WIDX_CHECKBOX_2) | (1 << WIDX_CHECKBOX_3) | (1 << WIDX_CHECKBOX_4));
|
||||||
w->pressed_widgets |= peep->staff_orders << WIDX_CHECKBOX_1;
|
w->pressed_widgets |= peep->StaffOrders << WIDX_CHECKBOX_1;
|
||||||
break;
|
break;
|
||||||
case STAFF_TYPE_MECHANIC:
|
case STAFF_TYPE_MECHANIC:
|
||||||
window_staff_options_widgets[WIDX_CHECKBOX_1].type = WWT_CHECKBOX;
|
window_staff_options_widgets[WIDX_CHECKBOX_1].type = WWT_CHECKBOX;
|
||||||
|
@ -846,7 +846,7 @@ void window_staff_options_invalidate(rct_window* w)
|
||||||
window_staff_options_widgets[WIDX_COSTUME_BOX].type = WWT_EMPTY;
|
window_staff_options_widgets[WIDX_COSTUME_BOX].type = WWT_EMPTY;
|
||||||
window_staff_options_widgets[WIDX_COSTUME_BTN].type = WWT_EMPTY;
|
window_staff_options_widgets[WIDX_COSTUME_BTN].type = WWT_EMPTY;
|
||||||
w->pressed_widgets &= ~((1 << WIDX_CHECKBOX_1) | (1 << WIDX_CHECKBOX_2));
|
w->pressed_widgets &= ~((1 << WIDX_CHECKBOX_1) | (1 << WIDX_CHECKBOX_2));
|
||||||
w->pressed_widgets |= peep->staff_orders << WIDX_CHECKBOX_1;
|
w->pressed_widgets |= peep->StaffOrders << WIDX_CHECKBOX_1;
|
||||||
break;
|
break;
|
||||||
case STAFF_TYPE_SECURITY:
|
case STAFF_TYPE_SECURITY:
|
||||||
// Security guards don't have an options screen.
|
// Security guards don't have an options screen.
|
||||||
|
|
|
@ -386,7 +386,7 @@ static void window_staff_list_tooldown(rct_window* w, rct_widgetindex widgetInde
|
||||||
|
|
||||||
if (isPatrolAreaSet)
|
if (isPatrolAreaSet)
|
||||||
{
|
{
|
||||||
if (!(gStaffModes[peep->staff_id] & 2))
|
if (!(gStaffModes[peep->StaffId] & 2))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -707,7 +707,7 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_
|
||||||
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { actionOffset, y }, actionColumnSize);
|
gfx_draw_string_left_clipped(dpi, format, gCommonFormatArgs, COLOUR_BLACK, { actionOffset, y }, actionColumnSize);
|
||||||
|
|
||||||
// True if a patrol path is set for the worker
|
// True if a patrol path is set for the worker
|
||||||
if (gStaffModes[peep->staff_id] & 2)
|
if (gStaffModes[peep->StaffId] & 2)
|
||||||
{
|
{
|
||||||
gfx_draw_sprite(dpi, SPR_STAFF_PATROL_PATH, nameColumnSize + 5, y, 0);
|
gfx_draw_sprite(dpi, SPR_STAFF_PATROL_PATH, nameColumnSize + 5, y, 0);
|
||||||
}
|
}
|
||||||
|
@ -715,7 +715,7 @@ void window_staff_list_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_
|
||||||
auto staffOrderIcon_x = nameColumnSize + 20;
|
auto staffOrderIcon_x = nameColumnSize + 20;
|
||||||
if (peep->staff_type != 3)
|
if (peep->staff_type != 3)
|
||||||
{
|
{
|
||||||
auto staffOrders = peep->staff_orders;
|
auto staffOrders = peep->StaffOrders;
|
||||||
auto staffOrderSprite = staffOrderBaseSprites[_windowStaffListSelectedTab];
|
auto staffOrderSprite = staffOrderBaseSprites[_windowStaffListSelectedTab];
|
||||||
|
|
||||||
while (staffOrders != 0)
|
while (staffOrders != 0)
|
||||||
|
|
|
@ -280,19 +280,19 @@ struct GameStateSnapshots final : public IGameStateSnapshots
|
||||||
{
|
{
|
||||||
COMPARE_FIELD(Peep, thoughts[i]);
|
COMPARE_FIELD(Peep, thoughts[i]);
|
||||||
}
|
}
|
||||||
COMPARE_FIELD(Peep, path_check_optimisation);
|
COMPARE_FIELD(Peep, PathCheckOptimisation);
|
||||||
COMPARE_FIELD(Peep, guest_heading_to_ride_id);
|
COMPARE_FIELD(Peep, GuestHeadingToRideId);
|
||||||
COMPARE_FIELD(Peep, staff_orders);
|
COMPARE_FIELD(Peep, StaffOrders);
|
||||||
COMPARE_FIELD(Peep, photo1_ride_ref);
|
COMPARE_FIELD(Peep, Photo1RideRef);
|
||||||
COMPARE_FIELD(Peep, peep_flags);
|
COMPARE_FIELD(Peep, PeepFlags);
|
||||||
COMPARE_FIELD(Peep, pathfind_goal);
|
COMPARE_FIELD(Peep, PathfindGoal);
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
COMPARE_FIELD(Peep, pathfind_history[i]);
|
COMPARE_FIELD(Peep, PathfindHistory[i]);
|
||||||
}
|
}
|
||||||
COMPARE_FIELD(Peep, no_action_frame_num);
|
COMPARE_FIELD(Peep, WalkingFrameNum);
|
||||||
COMPARE_FIELD(Peep, litter_count);
|
COMPARE_FIELD(Peep, LitterCount);
|
||||||
COMPARE_FIELD(Peep, time_on_ride);
|
COMPARE_FIELD(Peep, GuestTimeOnRide);
|
||||||
COMPARE_FIELD(Peep, DisgustingCount);
|
COMPARE_FIELD(Peep, DisgustingCount);
|
||||||
COMPARE_FIELD(Peep, PaidToEnter);
|
COMPARE_FIELD(Peep, PaidToEnter);
|
||||||
COMPARE_FIELD(Peep, PaidOnRides);
|
COMPARE_FIELD(Peep, PaidOnRides);
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_CHANGE_THIS);
|
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_CHANGE_THIS);
|
||||||
}
|
}
|
||||||
|
|
||||||
peep->peep_flags = _newFlags;
|
peep->PeepFlags = _newFlags;
|
||||||
|
|
||||||
return std::make_unique<GameActionResult>();
|
return std::make_unique<GameActionResult>();
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ private:
|
||||||
// remove any photos of this ride from peep
|
// remove any photos of this ride from peep
|
||||||
if (peep->ItemStandardFlags & PEEP_ITEM_PHOTO)
|
if (peep->ItemStandardFlags & PEEP_ITEM_PHOTO)
|
||||||
{
|
{
|
||||||
if (peep->photo1_ride_ref == _rideIndex)
|
if (peep->Photo1RideRef == _rideIndex)
|
||||||
{
|
{
|
||||||
peep->ItemStandardFlags &= ~PEEP_ITEM_PHOTO;
|
peep->ItemStandardFlags &= ~PEEP_ITEM_PHOTO;
|
||||||
}
|
}
|
||||||
|
@ -214,9 +214,9 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep->guest_heading_to_ride_id == _rideIndex)
|
if (peep->GuestHeadingToRideId == _rideIndex)
|
||||||
{
|
{
|
||||||
peep->guest_heading_to_ride_id = RIDE_ID_NULL;
|
peep->GuestHeadingToRideId = RIDE_ID_NULL;
|
||||||
}
|
}
|
||||||
if (peep->FavouriteRide == _rideIndex)
|
if (peep->FavouriteRide == _rideIndex)
|
||||||
{
|
{
|
||||||
|
|
|
@ -589,7 +589,7 @@ private:
|
||||||
// Clear the 'red-faced with anger' status if we're making the guest happy
|
// Clear the 'red-faced with anger' status if we're making the guest happy
|
||||||
if (value > 0)
|
if (value > 0)
|
||||||
{
|
{
|
||||||
peep->peep_flags &= ~PEEP_FLAGS_ANGRY;
|
peep->PeepFlags &= ~PEEP_FLAGS_ANGRY;
|
||||||
peep->Angriness = 0;
|
peep->Angriness = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -722,7 +722,7 @@ private:
|
||||||
{
|
{
|
||||||
if (scenario_rand_max(6) == 0)
|
if (scenario_rand_max(6) == 0)
|
||||||
{
|
{
|
||||||
peep->peep_flags |= PEEP_FLAGS_EXPLODE;
|
peep->PeepFlags |= PEEP_FLAGS_EXPLODE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,18 +163,18 @@ private:
|
||||||
newPeep->action = PEEP_ACTION_NONE_2;
|
newPeep->action = PEEP_ACTION_NONE_2;
|
||||||
newPeep->special_sprite = 0;
|
newPeep->special_sprite = 0;
|
||||||
newPeep->action_sprite_image_offset = 0;
|
newPeep->action_sprite_image_offset = 0;
|
||||||
newPeep->no_action_frame_num = 0;
|
newPeep->WalkingFrameNum = 0;
|
||||||
newPeep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
|
newPeep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
|
||||||
newPeep->path_check_optimisation = 0;
|
newPeep->PathCheckOptimisation = 0;
|
||||||
newPeep->type = PEEP_TYPE_STAFF;
|
newPeep->type = PEEP_TYPE_STAFF;
|
||||||
newPeep->outside_of_park = 0;
|
newPeep->outside_of_park = 0;
|
||||||
newPeep->peep_flags = 0;
|
newPeep->PeepFlags = 0;
|
||||||
newPeep->PaidToEnter = 0;
|
newPeep->PaidToEnter = 0;
|
||||||
newPeep->PaidOnRides = 0;
|
newPeep->PaidOnRides = 0;
|
||||||
newPeep->PaidOnFood = 0;
|
newPeep->PaidOnFood = 0;
|
||||||
newPeep->PaidOnSouvenirs = 0;
|
newPeep->PaidOnSouvenirs = 0;
|
||||||
newPeep->FavouriteRide = RIDE_ID_NULL;
|
newPeep->FavouriteRide = RIDE_ID_NULL;
|
||||||
newPeep->staff_orders = _staffOrders;
|
newPeep->StaffOrders = _staffOrders;
|
||||||
|
|
||||||
uint16_t idSearchSpriteIndex;
|
uint16_t idSearchSpriteIndex;
|
||||||
Peep* idSearchPeep;
|
Peep* idSearchPeep;
|
||||||
|
@ -232,10 +232,10 @@ private:
|
||||||
|
|
||||||
// Staff uses this
|
// Staff uses this
|
||||||
newPeep->time_in_park = gDateMonthsElapsed;
|
newPeep->time_in_park = gDateMonthsElapsed;
|
||||||
newPeep->pathfind_goal.x = 0xFF;
|
newPeep->PathfindGoal.x = 0xFF;
|
||||||
newPeep->pathfind_goal.y = 0xFF;
|
newPeep->PathfindGoal.y = 0xFF;
|
||||||
newPeep->pathfind_goal.z = 0xFF;
|
newPeep->PathfindGoal.z = 0xFF;
|
||||||
newPeep->pathfind_goal.direction = INVALID_DIRECTION;
|
newPeep->PathfindGoal.direction = INVALID_DIRECTION;
|
||||||
|
|
||||||
uint8_t colour = staff_get_colour(_staffType);
|
uint8_t colour = staff_get_colour(_staffType);
|
||||||
newPeep->tshirt_colour = colour;
|
newPeep->tshirt_colour = colour;
|
||||||
|
@ -244,9 +244,9 @@ private:
|
||||||
// Staff energy determines their walking speed
|
// Staff energy determines their walking speed
|
||||||
newPeep->energy = 0x60;
|
newPeep->energy = 0x60;
|
||||||
newPeep->energy_target = 0x60;
|
newPeep->energy_target = 0x60;
|
||||||
newPeep->staff_mowing_timeout = 0;
|
newPeep->StaffMowingTimeout = 0;
|
||||||
|
|
||||||
newPeep->staff_id = staffIndex;
|
newPeep->StaffId = staffIndex;
|
||||||
|
|
||||||
gStaffModes[staffIndex] = STAFF_MODE_WALK;
|
gStaffModes[staffIndex] = STAFF_MODE_WALK;
|
||||||
|
|
||||||
|
|
|
@ -95,10 +95,10 @@ public:
|
||||||
|
|
||||||
auto spriteType = static_cast<PeepSpriteType>(_costume + 4);
|
auto spriteType = static_cast<PeepSpriteType>(_costume + 4);
|
||||||
peep->sprite_type = spriteType;
|
peep->sprite_type = spriteType;
|
||||||
peep->peep_flags &= ~PEEP_FLAGS_SLOW_WALK;
|
peep->PeepFlags &= ~PEEP_FLAGS_SLOW_WALK;
|
||||||
if (peep_slow_walking_types[spriteType])
|
if (peep_slow_walking_types[spriteType])
|
||||||
{
|
{
|
||||||
peep->peep_flags |= PEEP_FLAGS_SLOW_WALK;
|
peep->PeepFlags |= PEEP_FLAGS_SLOW_WALK;
|
||||||
}
|
}
|
||||||
peep->action_frame = 0;
|
peep->action_frame = 0;
|
||||||
peep->UpdateCurrentActionSpriteType();
|
peep->UpdateCurrentActionSpriteType();
|
||||||
|
|
|
@ -68,7 +68,7 @@ public:
|
||||||
{
|
{
|
||||||
Peep* peep = GET_PEEP(_spriteIndex);
|
Peep* peep = GET_PEEP(_spriteIndex);
|
||||||
|
|
||||||
peep->staff_orders = _ordersId;
|
peep->StaffOrders = _ordersId;
|
||||||
|
|
||||||
window_invalidate_by_number(WC_PEEP, _spriteIndex);
|
window_invalidate_by_number(WC_PEEP, _spriteIndex);
|
||||||
auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST);
|
auto intent = Intent(INTENT_ACTION_REFRESH_STAFF_LIST);
|
||||||
|
|
|
@ -69,9 +69,9 @@ public:
|
||||||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t patrolOffset = peep->staff_id * STAFF_PATROL_AREA_SIZE;
|
int32_t patrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE;
|
||||||
|
|
||||||
staff_toggle_patrol_area(peep->staff_id, _loc.x, _loc.y);
|
staff_toggle_patrol_area(peep->StaffId, _loc.x, _loc.y);
|
||||||
|
|
||||||
bool isPatrolling = false;
|
bool isPatrolling = false;
|
||||||
for (int32_t i = 0; i < 128; i++)
|
for (int32_t i = 0; i < 128; i++)
|
||||||
|
@ -83,10 +83,10 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gStaffModes[peep->staff_id] &= ~(1 << 1);
|
gStaffModes[peep->StaffId] &= ~(1 << 1);
|
||||||
if (isPatrolling)
|
if (isPatrolling)
|
||||||
{
|
{
|
||||||
gStaffModes[peep->staff_id] |= (1 << 1);
|
gStaffModes[peep->StaffId] |= (1 << 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t y = 0; y < 4 * COORDS_XY_STEP; y += COORDS_XY_STEP)
|
for (int32_t y = 0; y < 4 * COORDS_XY_STEP; y += COORDS_XY_STEP)
|
||||||
|
|
|
@ -142,8 +142,8 @@ void marketing_set_guest_campaign(Peep* peep, int32_t campaignType)
|
||||||
peep->ItemStandardFlags |= PEEP_ITEM_VOUCHER;
|
peep->ItemStandardFlags |= PEEP_ITEM_VOUCHER;
|
||||||
peep->VoucherType = VOUCHER_TYPE_RIDE_FREE;
|
peep->VoucherType = VOUCHER_TYPE_RIDE_FREE;
|
||||||
peep->VoucherArguments = campaign->RideId;
|
peep->VoucherArguments = campaign->RideId;
|
||||||
peep->guest_heading_to_ride_id = campaign->RideId;
|
peep->GuestHeadingToRideId = campaign->RideId;
|
||||||
peep->peep_is_lost_countdown = 240;
|
peep->GuestIsLostCountdown = 240;
|
||||||
break;
|
break;
|
||||||
case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE:
|
case ADVERTISING_CAMPAIGN_PARK_ENTRY_HALF_PRICE:
|
||||||
peep->ItemStandardFlags |= PEEP_ITEM_VOUCHER;
|
peep->ItemStandardFlags |= PEEP_ITEM_VOUCHER;
|
||||||
|
@ -157,8 +157,8 @@ void marketing_set_guest_campaign(Peep* peep, int32_t campaignType)
|
||||||
case ADVERTISING_CAMPAIGN_PARK:
|
case ADVERTISING_CAMPAIGN_PARK:
|
||||||
break;
|
break;
|
||||||
case ADVERTISING_CAMPAIGN_RIDE:
|
case ADVERTISING_CAMPAIGN_RIDE:
|
||||||
peep->guest_heading_to_ride_id = campaign->RideId;
|
peep->GuestHeadingToRideId = campaign->RideId;
|
||||||
peep->peep_is_lost_countdown = 240;
|
peep->GuestIsLostCountdown = 240;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -498,22 +498,22 @@ void Guest::GivePassingPeepsIceCream(Guest* passingPeep)
|
||||||
*/
|
*/
|
||||||
void Guest::UpdateEasterEggInteractions()
|
void Guest::UpdateEasterEggInteractions()
|
||||||
{
|
{
|
||||||
if (peep_flags & PEEP_FLAGS_PURPLE)
|
if (PeepFlags & PEEP_FLAGS_PURPLE)
|
||||||
{
|
{
|
||||||
ApplyEasterEggToNearbyGuests(&Guest::GivePassingPeepsPurpleClothes);
|
ApplyEasterEggToNearbyGuests(&Guest::GivePassingPeepsPurpleClothes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_PIZZA)
|
if (PeepFlags & PEEP_FLAGS_PIZZA)
|
||||||
{
|
{
|
||||||
ApplyEasterEggToNearbyGuests(&Guest::GivePassingPeepsPizza);
|
ApplyEasterEggToNearbyGuests(&Guest::GivePassingPeepsPizza);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_CONTAGIOUS)
|
if (PeepFlags & PEEP_FLAGS_CONTAGIOUS)
|
||||||
{
|
{
|
||||||
ApplyEasterEggToNearbyGuests(&Guest::MakePassingPeepsSick);
|
ApplyEasterEggToNearbyGuests(&Guest::MakePassingPeepsSick);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_JOY)
|
if (PeepFlags & PEEP_FLAGS_JOY)
|
||||||
{
|
{
|
||||||
if (scenario_rand() <= 1456)
|
if (scenario_rand() <= 1456)
|
||||||
{
|
{
|
||||||
|
@ -527,7 +527,7 @@ void Guest::UpdateEasterEggInteractions()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_ICE_CREAM)
|
if (PeepFlags & PEEP_FLAGS_ICE_CREAM)
|
||||||
{
|
{
|
||||||
ApplyEasterEggToNearbyGuests(&Guest::GivePassingPeepsIceCream);
|
ApplyEasterEggToNearbyGuests(&Guest::GivePassingPeepsIceCream);
|
||||||
}
|
}
|
||||||
|
@ -550,28 +550,28 @@ int32_t Guest::GetEasterEggNameId() const
|
||||||
|
|
||||||
void Guest::HandleEasterEggName()
|
void Guest::HandleEasterEggName()
|
||||||
{
|
{
|
||||||
peep_flags &= ~PEEP_FLAGS_WAVING;
|
PeepFlags &= ~PEEP_FLAGS_WAVING;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_KATIE_BRAYSHAW))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_KATIE_BRAYSHAW))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_WAVING;
|
PeepFlags |= PEEP_FLAGS_WAVING;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_PHOTO;
|
PeepFlags &= ~PEEP_FLAGS_PHOTO;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_CHRIS_SAWYER))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_CHRIS_SAWYER))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_PHOTO;
|
PeepFlags |= PEEP_FLAGS_PHOTO;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_PAINTING;
|
PeepFlags &= ~PEEP_FLAGS_PAINTING;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_SIMON_FOSTER))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_SIMON_FOSTER))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_PAINTING;
|
PeepFlags |= PEEP_FLAGS_PAINTING;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_WOW;
|
PeepFlags &= ~PEEP_FLAGS_WOW;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_JOHN_WARDLEY))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_JOHN_WARDLEY))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_WOW;
|
PeepFlags |= PEEP_FLAGS_WOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_MELANIE_WARN))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_MELANIE_WARN))
|
||||||
|
@ -584,94 +584,94 @@ void Guest::HandleEasterEggName()
|
||||||
nausea_target = 0;
|
nausea_target = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_LITTER;
|
PeepFlags &= ~PEEP_FLAGS_LITTER;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_LISA_STIRLING))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_LISA_STIRLING))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_LITTER;
|
PeepFlags |= PEEP_FLAGS_LITTER;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_LOST;
|
PeepFlags &= ~PEEP_FLAGS_LOST;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_DONALD_MACRAE))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_DONALD_MACRAE))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_LOST;
|
PeepFlags |= PEEP_FLAGS_LOST;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_HUNGER;
|
PeepFlags &= ~PEEP_FLAGS_HUNGER;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_KATHERINE_MCGOWAN))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_KATHERINE_MCGOWAN))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_HUNGER;
|
PeepFlags |= PEEP_FLAGS_HUNGER;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_TOILET;
|
PeepFlags &= ~PEEP_FLAGS_TOILET;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_FRANCES_MCGOWAN))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_FRANCES_MCGOWAN))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_TOILET;
|
PeepFlags |= PEEP_FLAGS_TOILET;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_CROWDED;
|
PeepFlags &= ~PEEP_FLAGS_CROWDED;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_CORINA_MASSOURA))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_CORINA_MASSOURA))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_CROWDED;
|
PeepFlags |= PEEP_FLAGS_CROWDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_HAPPINESS;
|
PeepFlags &= ~PEEP_FLAGS_HAPPINESS;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_CAROL_YOUNG))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_CAROL_YOUNG))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_HAPPINESS;
|
PeepFlags |= PEEP_FLAGS_HAPPINESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_NAUSEA;
|
PeepFlags &= ~PEEP_FLAGS_NAUSEA;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_MIA_SHERIDAN))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_MIA_SHERIDAN))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_NAUSEA;
|
PeepFlags |= PEEP_FLAGS_NAUSEA;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_KATIE_RODGER))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_KATIE_RODGER))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_LEAVING_PARK;
|
PeepFlags |= PEEP_FLAGS_LEAVING_PARK;
|
||||||
peep_flags &= ~PEEP_FLAGS_PARK_ENTRANCE_CHOSEN;
|
PeepFlags &= ~PEEP_FLAGS_PARK_ENTRANCE_CHOSEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_PURPLE;
|
PeepFlags &= ~PEEP_FLAGS_PURPLE;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_EMMA_GARRELL))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_EMMA_GARRELL))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_PURPLE;
|
PeepFlags |= PEEP_FLAGS_PURPLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_PIZZA;
|
PeepFlags &= ~PEEP_FLAGS_PIZZA;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_JOANNE_BARTON))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_JOANNE_BARTON))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_PIZZA;
|
PeepFlags |= PEEP_FLAGS_PIZZA;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_CONTAGIOUS;
|
PeepFlags &= ~PEEP_FLAGS_CONTAGIOUS;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_FELICITY_ANDERSON))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_FELICITY_ANDERSON))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_CONTAGIOUS;
|
PeepFlags |= PEEP_FLAGS_CONTAGIOUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_JOY;
|
PeepFlags &= ~PEEP_FLAGS_JOY;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_KATIE_SMITH))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_KATIE_SMITH))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_JOY;
|
PeepFlags |= PEEP_FLAGS_JOY;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_ANGRY;
|
PeepFlags &= ~PEEP_FLAGS_ANGRY;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_EILIDH_BELL))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_EILIDH_BELL))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_ANGRY;
|
PeepFlags |= PEEP_FLAGS_ANGRY;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_ICE_CREAM;
|
PeepFlags &= ~PEEP_FLAGS_ICE_CREAM;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_NANCY_STILLWAGON))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_NANCY_STILLWAGON))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_ICE_CREAM;
|
PeepFlags |= PEEP_FLAGS_ICE_CREAM;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_HERE_WE_ARE;
|
PeepFlags &= ~PEEP_FLAGS_HERE_WE_ARE;
|
||||||
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_DAVID_ELLIS))
|
if (CheckEasterEggName(EASTEREGG_PEEP_NAME_DAVID_ELLIS))
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_HERE_WE_ARE;
|
PeepFlags |= PEEP_FLAGS_HERE_WE_ARE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -699,7 +699,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
||||||
* which is the condition for calling this function, is
|
* which is the condition for calling this function, is
|
||||||
* to reduce how often the content in this conditional
|
* to reduce how often the content in this conditional
|
||||||
* is executed to once every four calls. */
|
* is executed to once every four calls. */
|
||||||
if (peep_flags & PEEP_FLAGS_CROWDED)
|
if (PeepFlags & PEEP_FLAGS_CROWDED)
|
||||||
{
|
{
|
||||||
PeepThoughtType thought_type = crowded_thoughts[scenario_rand() & 0xF];
|
PeepThoughtType thought_type = crowded_thoughts[scenario_rand() & 0xF];
|
||||||
if (thought_type != PEEP_THOUGHT_TYPE_NONE)
|
if (thought_type != PEEP_THOUGHT_TYPE_NONE)
|
||||||
|
@ -708,7 +708,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_EXPLODE && x != LOCATION_NULL)
|
if (PeepFlags & PEEP_FLAGS_EXPLODE && x != LOCATION_NULL)
|
||||||
{
|
{
|
||||||
if (state == PEEP_STATE_WALKING || state == PEEP_STATE_SITTING)
|
if (state == PEEP_STATE_WALKING || state == PEEP_STATE_SITTING)
|
||||||
{
|
{
|
||||||
|
@ -722,28 +722,28 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
peep_flags &= ~PEEP_FLAGS_EXPLODE;
|
PeepFlags &= ~PEEP_FLAGS_EXPLODE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_HUNGER)
|
if (PeepFlags & PEEP_FLAGS_HUNGER)
|
||||||
{
|
{
|
||||||
if (hunger >= 15)
|
if (hunger >= 15)
|
||||||
hunger -= 15;
|
hunger -= 15;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_TOILET)
|
if (PeepFlags & PEEP_FLAGS_TOILET)
|
||||||
{
|
{
|
||||||
if (toilet <= 180)
|
if (toilet <= 180)
|
||||||
toilet += 50;
|
toilet += 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_HAPPINESS)
|
if (PeepFlags & PEEP_FLAGS_HAPPINESS)
|
||||||
{
|
{
|
||||||
happiness_target = 5;
|
happiness_target = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_NAUSEA)
|
if (PeepFlags & PEEP_FLAGS_NAUSEA)
|
||||||
{
|
{
|
||||||
nausea_target = 200;
|
nausea_target = 200;
|
||||||
if (nausea <= 130)
|
if (nausea <= 130)
|
||||||
|
@ -776,18 +776,18 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
||||||
|
|
||||||
if (state == PEEP_STATE_ON_RIDE || state == PEEP_STATE_ENTERING_RIDE)
|
if (state == PEEP_STATE_ON_RIDE || state == PEEP_STATE_ENTERING_RIDE)
|
||||||
{
|
{
|
||||||
time_on_ride = std::min(255, time_on_ride + 1);
|
GuestTimeOnRide = std::min(255, GuestTimeOnRide + 1);
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_WOW)
|
if (PeepFlags & PEEP_FLAGS_WOW)
|
||||||
{
|
{
|
||||||
InsertNewThought(PEEP_THOUGHT_TYPE_WOW2, PEEP_THOUGHT_ITEM_NONE);
|
InsertNewThought(PEEP_THOUGHT_TYPE_WOW2, PEEP_THOUGHT_ITEM_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (time_on_ride > 15)
|
if (GuestTimeOnRide > 15)
|
||||||
{
|
{
|
||||||
happiness_target = std::max(0, happiness_target - 5);
|
happiness_target = std::max(0, happiness_target - 5);
|
||||||
|
|
||||||
if (time_on_ride > 22)
|
if (GuestTimeOnRide > 22)
|
||||||
{
|
{
|
||||||
auto ride = get_ride(current_ride);
|
auto ride = get_ride(current_ride);
|
||||||
if (ride != nullptr)
|
if (ride != nullptr)
|
||||||
|
@ -802,8 +802,8 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == PEEP_STATE_WALKING && outside_of_park == 0 && !(peep_flags & PEEP_FLAGS_LEAVING_PARK) && no_of_rides == 0
|
if (state == PEEP_STATE_WALKING && outside_of_park == 0 && !(PeepFlags & PEEP_FLAGS_LEAVING_PARK) && no_of_rides == 0
|
||||||
&& guest_heading_to_ride_id == RIDE_ID_NULL)
|
&& GuestHeadingToRideId == RIDE_ID_NULL)
|
||||||
{
|
{
|
||||||
uint32_t time_duration = gScenarioTicks - time_in_park;
|
uint32_t time_duration = gScenarioTicks - time_in_park;
|
||||||
time_duration /= 2048;
|
time_duration /= 2048;
|
||||||
|
@ -812,7 +812,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
||||||
{
|
{
|
||||||
PickRideToGoOn();
|
PickRideToGoOn();
|
||||||
|
|
||||||
if (guest_heading_to_ride_id == RIDE_ID_NULL)
|
if (GuestHeadingToRideId == RIDE_ID_NULL)
|
||||||
{
|
{
|
||||||
happiness_target = std::max(happiness_target - 128, 0);
|
happiness_target = std::max(happiness_target - 128, 0);
|
||||||
peep_leave_park(this);
|
peep_leave_park(this);
|
||||||
|
@ -840,7 +840,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
||||||
uint8_t num_thoughts = 0;
|
uint8_t num_thoughts = 0;
|
||||||
PeepThoughtType possible_thoughts[5];
|
PeepThoughtType possible_thoughts[5];
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
{
|
{
|
||||||
possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_GO_HOME;
|
possible_thoughts[num_thoughts++] = PEEP_THOUGHT_TYPE_GO_HOME;
|
||||||
}
|
}
|
||||||
|
@ -1255,7 +1255,7 @@ void Guest::UpdateSitting()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((peep_flags & PEEP_FLAGS_LEAVING_PARK))
|
if ((PeepFlags & PEEP_FLAGS_LEAVING_PARK))
|
||||||
{
|
{
|
||||||
SetState(PEEP_STATE_WALKING);
|
SetState(PEEP_STATE_WALKING);
|
||||||
|
|
||||||
|
@ -1390,13 +1390,13 @@ bool Guest::HasEmptyContainer() const
|
||||||
*/
|
*/
|
||||||
void Guest::CheckIfLost()
|
void Guest::CheckIfLost()
|
||||||
{
|
{
|
||||||
if (!(peep_flags & PEEP_FLAGS_LOST))
|
if (!(PeepFlags & PEEP_FLAGS_LOST))
|
||||||
{
|
{
|
||||||
if (ride_get_count() < 2)
|
if (ride_get_count() < 2)
|
||||||
return;
|
return;
|
||||||
peep_flags ^= PEEP_FLAGS_21;
|
PeepFlags ^= PEEP_FLAGS_21;
|
||||||
|
|
||||||
if (!(peep_flags & PEEP_FLAGS_21))
|
if (!(PeepFlags & PEEP_FLAGS_21))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TimeLost++;
|
TimeLost++;
|
||||||
|
@ -1416,21 +1416,21 @@ void Guest::CheckIfLost()
|
||||||
*/
|
*/
|
||||||
void Guest::CheckCantFindRide()
|
void Guest::CheckCantFindRide()
|
||||||
{
|
{
|
||||||
if (guest_heading_to_ride_id == RIDE_ID_NULL)
|
if (GuestHeadingToRideId == RIDE_ID_NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Peeps will think "I can't find ride X" twice before giving up completely.
|
// Peeps will think "I can't find ride X" twice before giving up completely.
|
||||||
if (peep_is_lost_countdown == 30 || peep_is_lost_countdown == 60)
|
if (GuestIsLostCountdown == 30 || GuestIsLostCountdown == 60)
|
||||||
{
|
{
|
||||||
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_FIND, guest_heading_to_ride_id);
|
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_FIND, GuestHeadingToRideId);
|
||||||
happiness_target = std::max(happiness_target - 30, 0);
|
happiness_target = std::max(happiness_target - 30, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
peep_is_lost_countdown--;
|
GuestIsLostCountdown--;
|
||||||
if (peep_is_lost_countdown != 0)
|
if (GuestIsLostCountdown != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
guest_heading_to_ride_id = RIDE_ID_NULL;
|
GuestHeadingToRideId = RIDE_ID_NULL;
|
||||||
rct_window* w = window_find_by_number(WC_PEEP, sprite_index);
|
rct_window* w = window_find_by_number(WC_PEEP, sprite_index);
|
||||||
|
|
||||||
if (w)
|
if (w)
|
||||||
|
@ -1448,18 +1448,18 @@ void Guest::CheckCantFindRide()
|
||||||
*/
|
*/
|
||||||
void Guest::CheckCantFindExit()
|
void Guest::CheckCantFindExit()
|
||||||
{
|
{
|
||||||
if (!(peep_flags & PEEP_FLAGS_LEAVING_PARK))
|
if (!(PeepFlags & PEEP_FLAGS_LEAVING_PARK))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Peeps who can't find the park exit will continue to get less happy until they find it.
|
// Peeps who can't find the park exit will continue to get less happy until they find it.
|
||||||
if (peep_is_lost_countdown == 1)
|
if (GuestIsLostCountdown == 1)
|
||||||
{
|
{
|
||||||
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_FIND_EXIT, PEEP_THOUGHT_ITEM_NONE);
|
InsertNewThought(PEEP_THOUGHT_TYPE_CANT_FIND_EXIT, PEEP_THOUGHT_ITEM_NONE);
|
||||||
happiness_target = std::max(happiness_target - 30, 0);
|
happiness_target = std::max(happiness_target - 30, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (--peep_is_lost_countdown == 0)
|
if (--GuestIsLostCountdown == 0)
|
||||||
peep_is_lost_countdown = 90;
|
GuestIsLostCountdown = 90;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Main logic to decide whether a peep should buy an item in question
|
/** Main logic to decide whether a peep should buy an item in question
|
||||||
|
@ -1671,7 +1671,7 @@ loc_69B221:
|
||||||
time_to_consume = std::min((time_to_consume + consumptionTime), 255);
|
time_to_consume = std::min((time_to_consume + consumptionTime), 255);
|
||||||
|
|
||||||
if (shopItem == SHOP_ITEM_PHOTO)
|
if (shopItem == SHOP_ITEM_PHOTO)
|
||||||
photo1_ride_ref = ride->id;
|
Photo1RideRef = ride->id;
|
||||||
|
|
||||||
if (shopItem == SHOP_ITEM_PHOTO2)
|
if (shopItem == SHOP_ITEM_PHOTO2)
|
||||||
photo2_ride_ref = ride->id;
|
photo2_ride_ref = ride->id;
|
||||||
|
@ -1684,7 +1684,7 @@ loc_69B221:
|
||||||
|
|
||||||
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
|
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_INVENTORY;
|
||||||
UpdateSpriteType();
|
UpdateSpriteType();
|
||||||
if (peep_flags & PEEP_FLAGS_TRACKING)
|
if (PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
{
|
{
|
||||||
auto ft = Formatter::Common();
|
auto ft = Formatter::Common();
|
||||||
FormatNameTo(ft);
|
FormatNameTo(ft);
|
||||||
|
@ -1784,9 +1784,9 @@ void Guest::OnEnterRide(ride_id_t rideIndex)
|
||||||
void Guest::OnExitRide(ride_id_t rideIndex)
|
void Guest::OnExitRide(ride_id_t rideIndex)
|
||||||
{
|
{
|
||||||
auto ride = get_ride(rideIndex);
|
auto ride = get_ride(rideIndex);
|
||||||
if (peep_flags & PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE)
|
if (PeepFlags & PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE)
|
||||||
{
|
{
|
||||||
peep_flags &= ~PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE;
|
PeepFlags &= ~PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE;
|
||||||
FavouriteRide = rideIndex;
|
FavouriteRide = rideIndex;
|
||||||
// TODO fix this flag name or add another one
|
// TODO fix this flag name or add another one
|
||||||
window_invalidate_flags |= PEEP_INVALIDATE_STAFF_STATS;
|
window_invalidate_flags |= PEEP_INVALIDATE_STAFF_STATS;
|
||||||
|
@ -1795,13 +1795,13 @@ void Guest::OnExitRide(ride_id_t rideIndex)
|
||||||
nausea = nausea_target;
|
nausea = nausea_target;
|
||||||
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_STATS;
|
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_STATS;
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
peep_flags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN);
|
PeepFlags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN);
|
||||||
|
|
||||||
if (ride != nullptr && peep_should_go_on_ride_again(this, ride))
|
if (ride != nullptr && peep_should_go_on_ride_again(this, ride))
|
||||||
{
|
{
|
||||||
guest_heading_to_ride_id = rideIndex;
|
GuestHeadingToRideId = rideIndex;
|
||||||
peep_is_lost_countdown = 200;
|
GuestIsLostCountdown = 200;
|
||||||
peep_reset_pathfind_goal(this);
|
peep_reset_pathfind_goal(this);
|
||||||
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_ACTION;
|
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_ACTION;
|
||||||
}
|
}
|
||||||
|
@ -1850,9 +1850,9 @@ void Guest::PickRideToGoOn()
|
||||||
{
|
{
|
||||||
if (state != PEEP_STATE_WALKING)
|
if (state != PEEP_STATE_WALKING)
|
||||||
return;
|
return;
|
||||||
if (guest_heading_to_ride_id != RIDE_ID_NULL)
|
if (GuestHeadingToRideId != RIDE_ID_NULL)
|
||||||
return;
|
return;
|
||||||
if (peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
return;
|
return;
|
||||||
if (HasFood())
|
if (HasFood())
|
||||||
return;
|
return;
|
||||||
|
@ -1863,8 +1863,8 @@ void Guest::PickRideToGoOn()
|
||||||
if (ride != nullptr)
|
if (ride != nullptr)
|
||||||
{
|
{
|
||||||
// Head to that ride
|
// Head to that ride
|
||||||
guest_heading_to_ride_id = ride->id;
|
GuestHeadingToRideId = ride->id;
|
||||||
peep_is_lost_countdown = 200;
|
GuestIsLostCountdown = 200;
|
||||||
peep_reset_pathfind_goal(this);
|
peep_reset_pathfind_goal(this);
|
||||||
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_ACTION;
|
window_invalidate_flags |= PEEP_INVALIDATE_PEEP_ACTION;
|
||||||
|
|
||||||
|
@ -1977,7 +1977,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
||||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||||
|| ride_get_price(ride) != 0)
|
|| ride_get_price(ride) != 0)
|
||||||
{
|
{
|
||||||
if (peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
{
|
{
|
||||||
ChoseNotToGoOnRide(ride, peepAtRide, false);
|
ChoseNotToGoOnRide(ride, peepAtRide, false);
|
||||||
return false;
|
return false;
|
||||||
|
@ -2093,7 +2093,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
||||||
{
|
{
|
||||||
// If a peep has already decided that they're going to go on a ride, they'll skip the weather and
|
// If a peep has already decided that they're going to go on a ride, they'll skip the weather and
|
||||||
// excitement check and will only do a basic intensity check when they arrive at the ride itself.
|
// excitement check and will only do a basic intensity check when they arrive at the ride itself.
|
||||||
if (ride->id == guest_heading_to_ride_id)
|
if (ride->id == GuestHeadingToRideId)
|
||||||
{
|
{
|
||||||
if (ride->intensity > RIDE_RATING(10, 00) && !gCheatsIgnoreRideIntensity)
|
if (ride->intensity > RIDE_RATING(10, 00) && !gCheatsIgnoreRideIntensity)
|
||||||
{
|
{
|
||||||
|
@ -2200,7 +2200,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
||||||
if (value != 0xFFFF && !peep_has_voucher_for_free_ride(this, ride) && !(gParkFlags & PARK_FLAGS_NO_MONEY))
|
if (value != 0xFFFF && !peep_has_voucher_for_free_ride(this, ride) && !(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||||
{
|
{
|
||||||
// The amount peeps are willing to pay is decreased by 75% if they had to pay to enter the park.
|
// The amount peeps are willing to pay is decreased by 75% if they had to pay to enter the park.
|
||||||
if (peep_flags & PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY)
|
if (PeepFlags & PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY)
|
||||||
value /= 4;
|
value /= 4;
|
||||||
|
|
||||||
// Peeps won't pay more than twice the value of the ride.
|
// Peeps won't pay more than twice the value of the ride.
|
||||||
|
@ -2225,7 +2225,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
||||||
{
|
{
|
||||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||||
{
|
{
|
||||||
if (!(peep_flags & PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY))
|
if (!(PeepFlags & PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY))
|
||||||
{
|
{
|
||||||
InsertNewThought(PEEP_THOUGHT_TYPE_GOOD_VALUE, ride->id);
|
InsertNewThought(PEEP_THOUGHT_TYPE_GOOD_VALUE, ride->id);
|
||||||
}
|
}
|
||||||
|
@ -2240,7 +2240,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
||||||
ride_update_popularity(ride, 1);
|
ride_update_popularity(ride, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ride->id == guest_heading_to_ride_id)
|
if (ride->id == GuestHeadingToRideId)
|
||||||
{
|
{
|
||||||
peep_reset_ride_heading(this);
|
peep_reset_ride_heading(this);
|
||||||
}
|
}
|
||||||
|
@ -2319,7 +2319,7 @@ bool Guest::ShouldGoToShop(Ride* ride, bool peepAtShop)
|
||||||
if (peepAtShop)
|
if (peepAtShop)
|
||||||
{
|
{
|
||||||
ride_update_popularity(ride, 1);
|
ride_update_popularity(ride, 1);
|
||||||
if (ride->id == guest_heading_to_ride_id)
|
if (ride->id == GuestHeadingToRideId)
|
||||||
{
|
{
|
||||||
peep_reset_ride_heading(this);
|
peep_reset_ride_heading(this);
|
||||||
}
|
}
|
||||||
|
@ -2394,7 +2394,7 @@ void Guest::ChoseNotToGoOnRide(Ride* ride, bool peepAtRide, bool updateLastRide)
|
||||||
previous_ride_time_out = 0;
|
previous_ride_time_out = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ride->id == guest_heading_to_ride_id)
|
if (ride->id == GuestHeadingToRideId)
|
||||||
{
|
{
|
||||||
peep_reset_ride_heading(this);
|
peep_reset_ride_heading(this);
|
||||||
}
|
}
|
||||||
|
@ -2428,7 +2428,7 @@ static void peep_tried_to_enter_full_queue(Peep* peep, Ride* ride)
|
||||||
peep->previous_ride = ride->id;
|
peep->previous_ride = ride->id;
|
||||||
peep->previous_ride_time_out = 0;
|
peep->previous_ride_time_out = 0;
|
||||||
// Change status "Heading to" to "Walking" if queue is full
|
// Change status "Heading to" to "Walking" if queue is full
|
||||||
if (ride->id == peep->guest_heading_to_ride_id)
|
if (ride->id == peep->GuestHeadingToRideId)
|
||||||
{
|
{
|
||||||
peep_reset_ride_heading(peep);
|
peep_reset_ride_heading(peep);
|
||||||
}
|
}
|
||||||
|
@ -2436,7 +2436,7 @@ static void peep_tried_to_enter_full_queue(Peep* peep, Ride* ride)
|
||||||
|
|
||||||
static void peep_reset_ride_heading(Peep* peep)
|
static void peep_reset_ride_heading(Peep* peep)
|
||||||
{
|
{
|
||||||
peep->guest_heading_to_ride_id = RIDE_ID_NULL;
|
peep->GuestHeadingToRideId = RIDE_ID_NULL;
|
||||||
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_ACTION;
|
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_ACTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2548,7 +2548,7 @@ void Guest::GoToRideEntrance(Ride* ride)
|
||||||
sub_state = PEEP_RIDE_IN_ENTRANCE;
|
sub_state = PEEP_RIDE_IN_ENTRANCE;
|
||||||
|
|
||||||
rejoin_queue_timeout = 0;
|
rejoin_queue_timeout = 0;
|
||||||
time_on_ride = 0;
|
GuestTimeOnRide = 0;
|
||||||
|
|
||||||
RemoveFromQueue();
|
RemoveFromQueue();
|
||||||
}
|
}
|
||||||
|
@ -2711,14 +2711,14 @@ static int16_t peep_calculate_ride_satisfaction(Guest* peep, Ride* ride)
|
||||||
*/
|
*/
|
||||||
static void peep_update_favourite_ride(Peep* peep, Ride* ride)
|
static void peep_update_favourite_ride(Peep* peep, Ride* ride)
|
||||||
{
|
{
|
||||||
peep->peep_flags &= ~PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE;
|
peep->PeepFlags &= ~PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE;
|
||||||
uint8_t peepRideRating = std::clamp((ride->excitement / 4) + peep->happiness, 0, PEEP_MAX_HAPPINESS);
|
uint8_t peepRideRating = std::clamp((ride->excitement / 4) + peep->happiness, 0, PEEP_MAX_HAPPINESS);
|
||||||
if (peepRideRating >= peep->FavouriteRideRating)
|
if (peepRideRating >= peep->FavouriteRideRating)
|
||||||
{
|
{
|
||||||
if (peep->happiness >= 160 && peep->happiness_target >= 160)
|
if (peep->happiness >= 160 && peep->happiness_target >= 160)
|
||||||
{
|
{
|
||||||
peep->FavouriteRideRating = peepRideRating;
|
peep->FavouriteRideRating = peepRideRating;
|
||||||
peep->peep_flags |= PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE;
|
peep->PeepFlags |= PEEP_FLAGS_RIDE_SHOULD_BE_MARKED_AS_FAVOURITE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3083,7 +3083,7 @@ static void peep_decide_whether_to_leave_park(Peep* peep)
|
||||||
/* Peeps that are happy enough, have enough energy and
|
/* Peeps that are happy enough, have enough energy and
|
||||||
* (if appropriate) have enough money will always stay
|
* (if appropriate) have enough money will always stay
|
||||||
* in the park. */
|
* in the park. */
|
||||||
if (!(peep->peep_flags & PEEP_FLAGS_LEAVING_PARK))
|
if (!(peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK))
|
||||||
{
|
{
|
||||||
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
||||||
{
|
{
|
||||||
|
@ -3117,19 +3117,19 @@ static void peep_decide_whether_to_leave_park(Peep* peep)
|
||||||
*/
|
*/
|
||||||
static void peep_leave_park(Peep* peep)
|
static void peep_leave_park(Peep* peep)
|
||||||
{
|
{
|
||||||
peep->guest_heading_to_ride_id = RIDE_ID_NULL;
|
peep->GuestHeadingToRideId = RIDE_ID_NULL;
|
||||||
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
{
|
{
|
||||||
if (peep->peep_is_lost_countdown < 60)
|
if (peep->GuestIsLostCountdown < 60)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
peep->peep_is_lost_countdown = 254;
|
peep->GuestIsLostCountdown = 254;
|
||||||
peep->peep_flags |= PEEP_FLAGS_LEAVING_PARK;
|
peep->PeepFlags |= PEEP_FLAGS_LEAVING_PARK;
|
||||||
peep->peep_flags &= ~PEEP_FLAGS_PARK_ENTRANCE_CHOSEN;
|
peep->PeepFlags &= ~PEEP_FLAGS_PARK_ENTRANCE_CHOSEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
peep->InsertNewThought(PEEP_THOUGHT_TYPE_GO_HOME, PEEP_THOUGHT_ITEM_NONE);
|
peep->InsertNewThought(PEEP_THOUGHT_TYPE_GO_HOME, PEEP_THOUGHT_ITEM_NONE);
|
||||||
|
@ -3146,13 +3146,13 @@ template<typename T> static void peep_head_for_nearest_ride(Guest* peep, bool co
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
return;
|
return;
|
||||||
if (peep->x == LOCATION_NULL)
|
if (peep->x == LOCATION_NULL)
|
||||||
return;
|
return;
|
||||||
if (peep->guest_heading_to_ride_id != RIDE_ID_NULL)
|
if (peep->GuestHeadingToRideId != RIDE_ID_NULL)
|
||||||
{
|
{
|
||||||
auto ride = get_ride(peep->guest_heading_to_ride_id);
|
auto ride = get_ride(peep->GuestHeadingToRideId);
|
||||||
if (ride != nullptr && predicate(*ride))
|
if (ride != nullptr && predicate(*ride))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -3241,8 +3241,8 @@ template<typename T> static void peep_head_for_nearest_ride(Guest* peep, bool co
|
||||||
if (closestRide != nullptr)
|
if (closestRide != nullptr)
|
||||||
{
|
{
|
||||||
// Head to that ride
|
// Head to that ride
|
||||||
peep->guest_heading_to_ride_id = closestRide->id;
|
peep->GuestHeadingToRideId = closestRide->id;
|
||||||
peep->peep_is_lost_countdown = 200;
|
peep->GuestIsLostCountdown = 200;
|
||||||
peep_reset_pathfind_goal(peep);
|
peep_reset_pathfind_goal(peep);
|
||||||
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_ACTION;
|
peep->window_invalidate_flags |= PEEP_INVALIDATE_PEEP_ACTION;
|
||||||
peep->TimeLost = 0;
|
peep->TimeLost = 0;
|
||||||
|
@ -3325,7 +3325,7 @@ static bool peep_should_use_cash_machine(Peep* peep, ride_id_t rideIndex)
|
||||||
{
|
{
|
||||||
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
if (gParkFlags & PARK_FLAGS_NO_MONEY)
|
||||||
return false;
|
return false;
|
||||||
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
return false;
|
return false;
|
||||||
if (peep->cash_in_pocket > MONEY(20, 00))
|
if (peep->cash_in_pocket > MONEY(20, 00))
|
||||||
return false;
|
return false;
|
||||||
|
@ -3883,7 +3883,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride)
|
||||||
window_invalidate_by_number(WC_RIDE, current_ride);
|
window_invalidate_by_number(WC_RIDE, current_ride);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_TRACKING)
|
if (PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
{
|
{
|
||||||
auto nameArgLen = FormatNameTo(gCommonFormatArgs);
|
auto nameArgLen = FormatNameTo(gCommonFormatArgs);
|
||||||
ride->FormatNameTo(gCommonFormatArgs + nameArgLen);
|
ride->FormatNameTo(gCommonFormatArgs + nameArgLen);
|
||||||
|
@ -4079,7 +4079,7 @@ void Guest::UpdateRideEnterVehicle()
|
||||||
vehicle->mass += seatedPeepAsGuest->mass;
|
vehicle->mass += seatedPeepAsGuest->mass;
|
||||||
seatedPeepAsGuest->MoveTo({ LOCATION_NULL, 0, 0 });
|
seatedPeepAsGuest->MoveTo({ LOCATION_NULL, 0, 0 });
|
||||||
seatedPeepAsGuest->SetState(PEEP_STATE_ON_RIDE);
|
seatedPeepAsGuest->SetState(PEEP_STATE_ON_RIDE);
|
||||||
seatedPeepAsGuest->time_on_ride = 0;
|
seatedPeepAsGuest->GuestTimeOnRide = 0;
|
||||||
seatedPeepAsGuest->sub_state = PEEP_RIDE_ON_RIDE;
|
seatedPeepAsGuest->sub_state = PEEP_RIDE_ON_RIDE;
|
||||||
seatedPeepAsGuest->OnEnterRide(current_ride);
|
seatedPeepAsGuest->OnEnterRide(current_ride);
|
||||||
}
|
}
|
||||||
|
@ -4095,7 +4095,7 @@ void Guest::UpdateRideEnterVehicle()
|
||||||
|
|
||||||
SetState(PEEP_STATE_ON_RIDE);
|
SetState(PEEP_STATE_ON_RIDE);
|
||||||
|
|
||||||
time_on_ride = 0;
|
GuestTimeOnRide = 0;
|
||||||
sub_state = PEEP_RIDE_ON_RIDE;
|
sub_state = PEEP_RIDE_ON_RIDE;
|
||||||
OnEnterRide(current_ride);
|
OnEnterRide(current_ride);
|
||||||
}
|
}
|
||||||
|
@ -4989,7 +4989,7 @@ void Guest::UpdateRideLeaveExit()
|
||||||
|
|
||||||
OnExitRide(current_ride);
|
OnExitRide(current_ride);
|
||||||
|
|
||||||
if (ride != nullptr && (peep_flags & PEEP_FLAGS_TRACKING))
|
if (ride != nullptr && (PeepFlags & PEEP_FLAGS_TRACKING))
|
||||||
{
|
{
|
||||||
auto nameArgLen = FormatNameTo(gCommonFormatArgs);
|
auto nameArgLen = FormatNameTo(gCommonFormatArgs);
|
||||||
ride->FormatNameTo(gCommonFormatArgs + nameArgLen);
|
ride->FormatNameTo(gCommonFormatArgs + nameArgLen);
|
||||||
|
@ -5258,7 +5258,7 @@ void Guest::UpdateWalking()
|
||||||
if (!CheckForPath())
|
if (!CheckForPath())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_WAVING)
|
if (PeepFlags & PEEP_FLAGS_WAVING)
|
||||||
{
|
{
|
||||||
if (action >= PEEP_ACTION_NONE_1)
|
if (action >= PEEP_ACTION_NONE_1)
|
||||||
{
|
{
|
||||||
|
@ -5273,7 +5273,7 @@ void Guest::UpdateWalking()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_PHOTO)
|
if (PeepFlags & PEEP_FLAGS_PHOTO)
|
||||||
{
|
{
|
||||||
if (action >= PEEP_ACTION_NONE_1)
|
if (action >= PEEP_ACTION_NONE_1)
|
||||||
{
|
{
|
||||||
|
@ -5288,7 +5288,7 @@ void Guest::UpdateWalking()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_PAINTING)
|
if (PeepFlags & PEEP_FLAGS_PAINTING)
|
||||||
{
|
{
|
||||||
if (action >= PEEP_ACTION_NONE_1)
|
if (action >= PEEP_ACTION_NONE_1)
|
||||||
{
|
{
|
||||||
|
@ -5303,7 +5303,7 @@ void Guest::UpdateWalking()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_LITTER)
|
if (PeepFlags & PEEP_FLAGS_LITTER)
|
||||||
{
|
{
|
||||||
if (!GetNextIsSurface())
|
if (!GetNextIsSurface())
|
||||||
{
|
{
|
||||||
|
@ -5410,7 +5410,7 @@ void Guest::UpdateWalking()
|
||||||
if (state != PEEP_STATE_WALKING)
|
if (state != PEEP_STATE_WALKING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (nausea > 140)
|
if (nausea > 140)
|
||||||
|
@ -5988,7 +5988,7 @@ void Guest::UpdateUsingBin()
|
||||||
/* Simplifies 0x690582. Returns true if should find bench*/
|
/* Simplifies 0x690582. Returns true if should find bench*/
|
||||||
bool Guest::ShouldFindBench()
|
bool Guest::ShouldFindBench()
|
||||||
{
|
{
|
||||||
if (peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -6203,7 +6203,7 @@ static void peep_update_walking_break_scenery(Peep* peep)
|
||||||
if (gCheatsDisableVandalism)
|
if (gCheatsDisableVandalism)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(peep->peep_flags & PEEP_FLAGS_ANGRY))
|
if (!(peep->PeepFlags & PEEP_FLAGS_ANGRY))
|
||||||
{
|
{
|
||||||
if (peep->happiness >= 48)
|
if (peep->happiness >= 48)
|
||||||
return;
|
return;
|
||||||
|
@ -6212,7 +6212,7 @@ static void peep_update_walking_break_scenery(Peep* peep)
|
||||||
if (peep->state != PEEP_STATE_WALKING)
|
if (peep->state != PEEP_STATE_WALKING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((peep->litter_count & 0xC0) != 0xC0 && (peep->DisgustingCount & 0xC0) != 0xC0)
|
if ((peep->LitterCount & 0xC0) != 0xC0 && (peep->DisgustingCount & 0xC0) != 0xC0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((scenario_rand() & 0xFFFF) > 3276)
|
if ((scenario_rand() & 0xFFFF) > 3276)
|
||||||
|
@ -6765,16 +6765,16 @@ void Guest::SetSpriteType(PeepSpriteType new_sprite_type)
|
||||||
|
|
||||||
sprite_type = new_sprite_type;
|
sprite_type = new_sprite_type;
|
||||||
action_sprite_image_offset = 0;
|
action_sprite_image_offset = 0;
|
||||||
no_action_frame_num = 0;
|
WalkingFrameNum = 0;
|
||||||
|
|
||||||
if (action >= PEEP_ACTION_NONE_1)
|
if (action >= PEEP_ACTION_NONE_1)
|
||||||
action = PEEP_ACTION_NONE_2;
|
action = PEEP_ACTION_NONE_2;
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_SLOW_WALK;
|
PeepFlags &= ~PEEP_FLAGS_SLOW_WALK;
|
||||||
Guard::Assert(new_sprite_type < std::size(gSpriteTypeToSlowWalkMap));
|
Guard::Assert(new_sprite_type < std::size(gSpriteTypeToSlowWalkMap));
|
||||||
if (gSpriteTypeToSlowWalkMap[new_sprite_type])
|
if (gSpriteTypeToSlowWalkMap[new_sprite_type])
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_SLOW_WALK;
|
PeepFlags |= PEEP_FLAGS_SLOW_WALK;
|
||||||
}
|
}
|
||||||
|
|
||||||
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID;
|
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID;
|
||||||
|
@ -6944,5 +6944,5 @@ void Guest::UpdateSpriteType()
|
||||||
|
|
||||||
bool Guest::HeadingForRideOrParkExit() const
|
bool Guest::HeadingForRideOrParkExit() const
|
||||||
{
|
{
|
||||||
return (peep_flags & PEEP_FLAGS_LEAVING_PARK) || (guest_heading_to_ride_id != 0xFF);
|
return (PeepFlags & PEEP_FLAGS_LEAVING_PARK) || (GuestHeadingToRideId != 0xFF);
|
||||||
}
|
}
|
||||||
|
|
|
@ -442,15 +442,15 @@ static uint8_t peep_pathfind_get_max_number_junctions(Peep* peep)
|
||||||
return 8;
|
return 8;
|
||||||
|
|
||||||
// PEEP_FLAGS_2? It's cleared here but not set anywhere!
|
// PEEP_FLAGS_2? It's cleared here but not set anywhere!
|
||||||
if ((peep->peep_flags & PEEP_FLAGS_2))
|
if ((peep->PeepFlags & PEEP_FLAGS_2))
|
||||||
{
|
{
|
||||||
if ((scenario_rand() & 0xFFFF) <= 7281)
|
if ((scenario_rand() & 0xFFFF) <= 7281)
|
||||||
peep->peep_flags &= ~PEEP_FLAGS_2;
|
peep->PeepFlags &= ~PEEP_FLAGS_2;
|
||||||
|
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK && peep->peep_is_lost_countdown < 90)
|
if (peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK && peep->GuestIsLostCountdown < 90)
|
||||||
{
|
{
|
||||||
return 8;
|
return 8;
|
||||||
}
|
}
|
||||||
|
@ -458,7 +458,7 @@ static uint8_t peep_pathfind_get_max_number_junctions(Peep* peep)
|
||||||
if (peep->ItemStandardFlags & PEEP_ITEM_MAP)
|
if (peep->ItemStandardFlags & PEEP_ITEM_MAP)
|
||||||
return 7;
|
return 7;
|
||||||
|
|
||||||
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
return 7;
|
return 7;
|
||||||
|
|
||||||
return 5;
|
return 5;
|
||||||
|
@ -975,14 +975,14 @@ static void peep_pathfind_heuristic_search(
|
||||||
/* First check if going through the junction would be
|
/* First check if going through the junction would be
|
||||||
* a loop. If so, the current search path ends here.
|
* a loop. If so, the current search path ends here.
|
||||||
* Path finding loop detection can take advantage of both the
|
* Path finding loop detection can take advantage of both the
|
||||||
* peep->pathfind_history - loops through remembered junctions
|
* peep->PathfindHistory - loops through remembered junctions
|
||||||
* the peep has already passed through getting to its
|
* the peep has already passed through getting to its
|
||||||
* current position while on the way to its current goal;
|
* current position while on the way to its current goal;
|
||||||
* _peepPathFindHistory - loops in the current search path. */
|
* _peepPathFindHistory - loops in the current search path. */
|
||||||
bool pathLoop = false;
|
bool pathLoop = false;
|
||||||
/* Check the peep->pathfind_history to see if this junction has
|
/* Check the peep->PathfindHistory to see if this junction has
|
||||||
* already been visited by the peep while heading for this goal. */
|
* already been visited by the peep while heading for this goal. */
|
||||||
for (auto& pathfindHistory : peep->pathfind_history)
|
for (auto& pathfindHistory : peep->PathfindHistory)
|
||||||
{
|
{
|
||||||
if (pathfindHistory.x == loc.x && pathfindHistory.y == loc.y && pathfindHistory.z == loc.z)
|
if (pathfindHistory.x == loc.x && pathfindHistory.y == loc.y && pathfindHistory.z == loc.z)
|
||||||
{
|
{
|
||||||
|
@ -1221,7 +1221,7 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if this path element is a thin junction.
|
/* Check if this path element is a thin junction.
|
||||||
* Only 'thin' junctions are remembered in peep->pathfind_history.
|
* Only 'thin' junctions are remembered in peep->PathfindHistory.
|
||||||
* NO attempt is made to merge the overlaid path elements and
|
* NO attempt is made to merge the overlaid path elements and
|
||||||
* check if the combination is 'thin'!
|
* check if the combination is 'thin'!
|
||||||
* The junction is considered 'thin' simply if any of the
|
* The junction is considered 'thin' simply if any of the
|
||||||
|
@ -1237,10 +1237,10 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
|
||||||
|
|
||||||
permitted_edges &= 0xF;
|
permitted_edges &= 0xF;
|
||||||
uint8_t edges = permitted_edges;
|
uint8_t edges = permitted_edges;
|
||||||
if (isThin && peep->pathfind_goal.x == goal.x && peep->pathfind_goal.y == goal.y && peep->pathfind_goal.z == goal.z)
|
if (isThin && peep->PathfindGoal.x == goal.x && peep->PathfindGoal.y == goal.y && peep->PathfindGoal.z == goal.z)
|
||||||
{
|
{
|
||||||
/* Use of peep->pathfind_history[]:
|
/* Use of peep->PathfindHistory[]:
|
||||||
* When walking to a goal, the peep pathfind_history stores
|
* When walking to a goal, the peep PathfindHistory stores
|
||||||
* the last 4 thin junctions that the peep walked through.
|
* the last 4 thin junctions that the peep walked through.
|
||||||
* For each of these 4 thin junctions the peep remembers
|
* For each of these 4 thin junctions the peep remembers
|
||||||
* those edges it has not yet taken.
|
* those edges it has not yet taken.
|
||||||
|
@ -1254,11 +1254,11 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
|
||||||
/* If the peep remembers walking through this junction
|
/* If the peep remembers walking through this junction
|
||||||
* previously while heading for its goal, retrieve the
|
* previously while heading for its goal, retrieve the
|
||||||
* directions it has not yet tried. */
|
* directions it has not yet tried. */
|
||||||
for (auto& pathfindHistory : peep->pathfind_history)
|
for (auto& pathfindHistory : peep->PathfindHistory)
|
||||||
{
|
{
|
||||||
if (pathfindHistory.x == loc.x && pathfindHistory.y == loc.y && pathfindHistory.z == loc.z)
|
if (pathfindHistory.x == loc.x && pathfindHistory.y == loc.y && pathfindHistory.z == loc.z)
|
||||||
{
|
{
|
||||||
/* Fix broken pathfind_history[i].direction
|
/* Fix broken PathfindHistory[i].direction
|
||||||
* which have untried directions that are not
|
* which have untried directions that are not
|
||||||
* currently possible - could be due to pathing
|
* currently possible - could be due to pathing
|
||||||
* changes or in earlier code .directions was
|
* changes or in earlier code .directions was
|
||||||
|
@ -1303,17 +1303,17 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this is a new goal for the peep. Store it and reset the peep's
|
/* If this is a new goal for the peep. Store it and reset the peep's
|
||||||
* pathfind_history. */
|
* PathfindHistory. */
|
||||||
if (!direction_valid(peep->pathfind_goal.direction) || peep->pathfind_goal.x != goal.x || peep->pathfind_goal.y != goal.y
|
if (!direction_valid(peep->PathfindGoal.direction) || peep->PathfindGoal.x != goal.x || peep->PathfindGoal.y != goal.y
|
||||||
|| peep->pathfind_goal.z != goal.z)
|
|| peep->PathfindGoal.z != goal.z)
|
||||||
{
|
{
|
||||||
peep->pathfind_goal.x = goal.x;
|
peep->PathfindGoal.x = goal.x;
|
||||||
peep->pathfind_goal.y = goal.y;
|
peep->PathfindGoal.y = goal.y;
|
||||||
peep->pathfind_goal.z = goal.z;
|
peep->PathfindGoal.z = goal.z;
|
||||||
peep->pathfind_goal.direction = 0;
|
peep->PathfindGoal.direction = 0;
|
||||||
|
|
||||||
// Clear pathfinding history
|
// Clear pathfinding history
|
||||||
std::fill_n(reinterpret_cast<uint8_t*>(peep->pathfind_history), sizeof(peep->pathfind_history), 0xFF);
|
std::fill_n(reinterpret_cast<uint8_t*>(peep->PathfindHistory), sizeof(peep->PathfindHistory), 0xFF);
|
||||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||||
if (gPathFindDebug)
|
if (gPathFindDebug)
|
||||||
{
|
{
|
||||||
|
@ -1488,15 +1488,15 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
|
||||||
{
|
{
|
||||||
for (int32_t i = 0; i < 4; ++i)
|
for (int32_t i = 0; i < 4; ++i)
|
||||||
{
|
{
|
||||||
if (peep->pathfind_history[i].x == loc.x && peep->pathfind_history[i].y == loc.y
|
if (peep->PathfindHistory[i].x == loc.x && peep->PathfindHistory[i].y == loc.y
|
||||||
&& peep->pathfind_history[i].z == loc.z)
|
&& peep->PathfindHistory[i].z == loc.z)
|
||||||
{
|
{
|
||||||
/* Peep remembers this junction, so remove the
|
/* Peep remembers this junction, so remove the
|
||||||
* chosen_edge from those left to try. */
|
* chosen_edge from those left to try. */
|
||||||
peep->pathfind_history[i].direction &= ~(1 << chosen_edge);
|
peep->PathfindHistory[i].direction &= ~(1 << chosen_edge);
|
||||||
/* Also remove the edge through which the peep
|
/* Also remove the edge through which the peep
|
||||||
* entered the junction from those left to try. */
|
* entered the junction from those left to try. */
|
||||||
peep->pathfind_history[i].direction &= ~(1 << direction_reverse(peep->direction));
|
peep->PathfindHistory[i].direction &= ~(1 << direction_reverse(peep->direction));
|
||||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||||
if (gPathFindDebug)
|
if (gPathFindDebug)
|
||||||
{
|
{
|
||||||
|
@ -1511,17 +1511,17 @@ Direction peep_pathfind_choose_direction(const TileCoordsXYZ& loc, Peep* peep)
|
||||||
|
|
||||||
/* Peep does not remember this junction, so forget a junction
|
/* Peep does not remember this junction, so forget a junction
|
||||||
* and remember this junction. */
|
* and remember this junction. */
|
||||||
int32_t i = peep->pathfind_goal.direction++;
|
int32_t i = peep->PathfindGoal.direction++;
|
||||||
peep->pathfind_goal.direction &= 3;
|
peep->PathfindGoal.direction &= 3;
|
||||||
peep->pathfind_history[i].x = static_cast<uint8_t>(loc.x);
|
peep->PathfindHistory[i].x = static_cast<uint8_t>(loc.x);
|
||||||
peep->pathfind_history[i].y = static_cast<uint8_t>(loc.y);
|
peep->PathfindHistory[i].y = static_cast<uint8_t>(loc.y);
|
||||||
peep->pathfind_history[i].z = loc.z;
|
peep->PathfindHistory[i].z = loc.z;
|
||||||
peep->pathfind_history[i].direction = permitted_edges;
|
peep->PathfindHistory[i].direction = permitted_edges;
|
||||||
/* Remove the chosen_edge from those left to try. */
|
/* Remove the chosen_edge from those left to try. */
|
||||||
peep->pathfind_history[i].direction &= ~(1 << chosen_edge);
|
peep->PathfindHistory[i].direction &= ~(1 << chosen_edge);
|
||||||
/* Also remove the edge through which the peep
|
/* Also remove the edge through which the peep
|
||||||
* entered the junction from those left to try. */
|
* entered the junction from those left to try. */
|
||||||
peep->pathfind_history[i].direction &= ~(1 << direction_reverse(peep->direction));
|
peep->PathfindHistory[i].direction &= ~(1 << direction_reverse(peep->direction));
|
||||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||||
if (gPathFindDebug)
|
if (gPathFindDebug)
|
||||||
{
|
{
|
||||||
|
@ -1646,13 +1646,13 @@ static int32_t guest_path_find_leaving_park(Peep* peep, uint8_t edges)
|
||||||
static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges)
|
static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges)
|
||||||
{
|
{
|
||||||
// If entrance no longer exists, choose a new one
|
// If entrance no longer exists, choose a new one
|
||||||
if ((peep->peep_flags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN) && peep->current_ride >= gParkEntrances.size())
|
if ((peep->PeepFlags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN) && peep->current_ride >= gParkEntrances.size())
|
||||||
{
|
{
|
||||||
peep->current_ride = 0xFF;
|
peep->current_ride = 0xFF;
|
||||||
peep->peep_flags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN);
|
peep->PeepFlags &= ~(PEEP_FLAGS_PARK_ENTRANCE_CHOSEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(peep->peep_flags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN))
|
if (!(peep->PeepFlags & PEEP_FLAGS_PARK_ENTRANCE_CHOSEN))
|
||||||
{
|
{
|
||||||
uint8_t chosenEntrance = 0xFF;
|
uint8_t chosenEntrance = 0xFF;
|
||||||
uint16_t nearestDist = 0xFFFF;
|
uint16_t nearestDist = 0xFFFF;
|
||||||
|
@ -1672,7 +1672,7 @@ static int32_t guest_path_find_park_entrance(Peep* peep, uint8_t edges)
|
||||||
return guest_path_find_aimless(peep, edges);
|
return guest_path_find_aimless(peep, edges);
|
||||||
|
|
||||||
peep->current_ride = chosenEntrance;
|
peep->current_ride = chosenEntrance;
|
||||||
peep->peep_flags |= PEEP_FLAGS_PARK_ENTRANCE_CHOSEN;
|
peep->PeepFlags |= PEEP_FLAGS_PARK_ENTRANCE_CHOSEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto& entrance = gParkEntrances[peep->current_ride];
|
const auto& entrance = gParkEntrances[peep->current_ride];
|
||||||
|
@ -2041,7 +2041,7 @@ int32_t guest_path_finding(Guest* peep)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
{
|
{
|
||||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||||
if (gPathFindDebug)
|
if (gPathFindDebug)
|
||||||
|
@ -2053,7 +2053,7 @@ int32_t guest_path_finding(Guest* peep)
|
||||||
return guest_path_find_park_entrance(peep, edges);
|
return guest_path_find_park_entrance(peep, edges);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep->guest_heading_to_ride_id == 0xFF)
|
if (peep->GuestHeadingToRideId == 0xFF)
|
||||||
{
|
{
|
||||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||||
if (gPathFindDebug)
|
if (gPathFindDebug)
|
||||||
|
@ -2066,7 +2066,7 @@ int32_t guest_path_finding(Guest* peep)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Peep is heading for a ride.
|
// Peep is heading for a ride.
|
||||||
ride_id_t rideIndex = peep->guest_heading_to_ride_id;
|
ride_id_t rideIndex = peep->GuestHeadingToRideId;
|
||||||
auto ride = get_ride(rideIndex);
|
auto ride = get_ride(rideIndex);
|
||||||
if (ride == nullptr || ride->status != RIDE_STATUS_OPEN)
|
if (ride == nullptr || ride->status != RIDE_STATUS_OPEN)
|
||||||
{
|
{
|
||||||
|
@ -2147,7 +2147,7 @@ int32_t guest_path_finding(Guest* peep)
|
||||||
if (direction == INVALID_DIRECTION)
|
if (direction == INVALID_DIRECTION)
|
||||||
{
|
{
|
||||||
/* Heuristic search failed for all directions.
|
/* Heuristic search failed for all directions.
|
||||||
* Reset the pathfind_goal - this means that the pathfind_history
|
* Reset the PathfindGoal - this means that the PathfindHistory
|
||||||
* will be reset in the next call to peep_pathfind_choose_direction().
|
* will be reset in the next call to peep_pathfind_choose_direction().
|
||||||
* This lets the heuristic search "try again" in case the player has
|
* This lets the heuristic search "try again" in case the player has
|
||||||
* edited the path layout or the mechanic was already stuck in the
|
* edited the path layout or the mechanic was already stuck in the
|
||||||
|
|
|
@ -471,8 +471,8 @@ static void peep_128_tick_update(Peep* peep, int32_t index)
|
||||||
*/
|
*/
|
||||||
bool Peep::CheckForPath()
|
bool Peep::CheckForPath()
|
||||||
{
|
{
|
||||||
path_check_optimisation++;
|
PathCheckOptimisation++;
|
||||||
if ((path_check_optimisation & 0xF) != (sprite_index & 0xF))
|
if ((PathCheckOptimisation & 0xF) != (sprite_index & 0xF))
|
||||||
{
|
{
|
||||||
// This condition makes the check happen less often
|
// This condition makes the check happen less often
|
||||||
// As a side effect peeps hover for a short,
|
// As a side effect peeps hover for a short,
|
||||||
|
@ -631,14 +631,14 @@ std::optional<CoordsXY> Peep::UpdateAction(int16_t& xy_distance)
|
||||||
sprite_direction = nextDirection;
|
sprite_direction = nextDirection;
|
||||||
CoordsXY loc = { x, y };
|
CoordsXY loc = { x, y };
|
||||||
loc += word_981D7C[nextDirection / 8];
|
loc += word_981D7C[nextDirection / 8];
|
||||||
no_action_frame_num++;
|
WalkingFrameNum++;
|
||||||
const rct_peep_animation* peepAnimation = g_peep_animation_entries[sprite_type].sprite_animation;
|
const rct_peep_animation* peepAnimation = g_peep_animation_entries[sprite_type].sprite_animation;
|
||||||
const uint8_t* imageOffset = peepAnimation[action_sprite_type].frame_offsets;
|
const uint8_t* imageOffset = peepAnimation[action_sprite_type].frame_offsets;
|
||||||
if (no_action_frame_num >= peepAnimation[action_sprite_type].num_frames)
|
if (WalkingFrameNum >= peepAnimation[action_sprite_type].num_frames)
|
||||||
{
|
{
|
||||||
no_action_frame_num = 0;
|
WalkingFrameNum = 0;
|
||||||
}
|
}
|
||||||
action_sprite_image_offset = imageOffset[no_action_frame_num];
|
action_sprite_image_offset = imageOffset[WalkingFrameNum];
|
||||||
return loc;
|
return loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -758,7 +758,7 @@ void Peep::PickupAbort(int32_t old_x)
|
||||||
special_sprite = 0;
|
special_sprite = 0;
|
||||||
action_sprite_image_offset = 0;
|
action_sprite_image_offset = 0;
|
||||||
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
|
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
|
||||||
path_check_optimisation = 0;
|
PathCheckOptimisation = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gPickupPeepImage = UINT32_MAX;
|
gPickupPeepImage = UINT32_MAX;
|
||||||
|
@ -807,7 +807,7 @@ bool Peep::Place(const TileCoordsXYZ& location, bool apply)
|
||||||
special_sprite = 0;
|
special_sprite = 0;
|
||||||
action_sprite_image_offset = 0;
|
action_sprite_image_offset = 0;
|
||||||
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
|
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
|
||||||
path_check_optimisation = 0;
|
PathCheckOptimisation = 0;
|
||||||
sprite_position_tween_reset();
|
sprite_position_tween_reset();
|
||||||
|
|
||||||
if (type == PEEP_TYPE_GUEST)
|
if (type == PEEP_TYPE_GUEST)
|
||||||
|
@ -848,7 +848,7 @@ void peep_sprite_remove(Peep* peep)
|
||||||
{
|
{
|
||||||
window_invalidate_by_class(WC_STAFF_LIST);
|
window_invalidate_by_class(WC_STAFF_LIST);
|
||||||
|
|
||||||
gStaffModes[peep->staff_id] = 0;
|
gStaffModes[peep->StaffId] = 0;
|
||||||
peep->type = PEEP_TYPE_INVALID;
|
peep->type = PEEP_TYPE_INVALID;
|
||||||
staff_update_greyed_patrol_areas();
|
staff_update_greyed_patrol_areas();
|
||||||
peep->type = PEEP_TYPE_STAFF;
|
peep->type = PEEP_TYPE_STAFF;
|
||||||
|
@ -1123,7 +1123,7 @@ void Peep::Update()
|
||||||
uint32_t stepsToTake = energy;
|
uint32_t stepsToTake = energy;
|
||||||
if (stepsToTake < 95 && state == PEEP_STATE_QUEUING)
|
if (stepsToTake < 95 && state == PEEP_STATE_QUEUING)
|
||||||
stepsToTake = 95;
|
stepsToTake = 95;
|
||||||
if ((peep_flags & PEEP_FLAGS_SLOW_WALK) && state != PEEP_STATE_QUEUING)
|
if ((PeepFlags & PEEP_FLAGS_SLOW_WALK) && state != PEEP_STATE_QUEUING)
|
||||||
stepsToTake /= 2;
|
stepsToTake /= 2;
|
||||||
if (action == PEEP_ACTION_NONE_2 && (GetNextIsSloped()))
|
if (action == PEEP_ACTION_NONE_2 && (GetNextIsSloped()))
|
||||||
{
|
{
|
||||||
|
@ -1209,34 +1209,34 @@ void peep_problem_warnings_update()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PEEP_THOUGHT_TYPE_HUNGRY: // 0x14
|
case PEEP_THOUGHT_TYPE_HUNGRY: // 0x14
|
||||||
if (peep->guest_heading_to_ride_id == 0xFF)
|
if (peep->GuestHeadingToRideId == 0xFF)
|
||||||
{
|
{
|
||||||
hunger_counter++;
|
hunger_counter++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ride = get_ride(peep->guest_heading_to_ride_id);
|
ride = get_ride(peep->GuestHeadingToRideId);
|
||||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE))
|
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||||
hunger_counter++;
|
hunger_counter++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PEEP_THOUGHT_TYPE_THIRSTY:
|
case PEEP_THOUGHT_TYPE_THIRSTY:
|
||||||
if (peep->guest_heading_to_ride_id == 0xFF)
|
if (peep->GuestHeadingToRideId == 0xFF)
|
||||||
{
|
{
|
||||||
thirst_counter++;
|
thirst_counter++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ride = get_ride(peep->guest_heading_to_ride_id);
|
ride = get_ride(peep->GuestHeadingToRideId);
|
||||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_SELLS_DRINKS))
|
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_SELLS_DRINKS))
|
||||||
thirst_counter++;
|
thirst_counter++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PEEP_THOUGHT_TYPE_TOILET:
|
case PEEP_THOUGHT_TYPE_TOILET:
|
||||||
if (peep->guest_heading_to_ride_id == 0xFF)
|
if (peep->GuestHeadingToRideId == 0xFF)
|
||||||
{
|
{
|
||||||
toilet_counter++;
|
toilet_counter++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ride = get_ride(peep->guest_heading_to_ride_id);
|
ride = get_ride(peep->GuestHeadingToRideId);
|
||||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_TOILET))
|
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_TOILET))
|
||||||
toilet_counter++;
|
toilet_counter++;
|
||||||
break;
|
break;
|
||||||
|
@ -1631,9 +1631,9 @@ Peep* Peep::Generate(const CoordsXYZ& coords)
|
||||||
peep->action = PEEP_ACTION_NONE_2;
|
peep->action = PEEP_ACTION_NONE_2;
|
||||||
peep->special_sprite = 0;
|
peep->special_sprite = 0;
|
||||||
peep->action_sprite_image_offset = 0;
|
peep->action_sprite_image_offset = 0;
|
||||||
peep->no_action_frame_num = 0;
|
peep->WalkingFrameNum = 0;
|
||||||
peep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
|
peep->action_sprite_type = PEEP_ACTION_SPRITE_TYPE_NONE;
|
||||||
peep->peep_flags = 0;
|
peep->PeepFlags = 0;
|
||||||
peep->FavouriteRide = RIDE_ID_NULL;
|
peep->FavouriteRide = RIDE_ID_NULL;
|
||||||
peep->FavouriteRideRating = 0;
|
peep->FavouriteRideRating = 0;
|
||||||
|
|
||||||
|
@ -1645,7 +1645,7 @@ Peep* Peep::Generate(const CoordsXYZ& coords)
|
||||||
peep->MoveTo(coords);
|
peep->MoveTo(coords);
|
||||||
peep->sprite_direction = 0;
|
peep->sprite_direction = 0;
|
||||||
peep->mass = (scenario_rand() & 0x1F) + 45;
|
peep->mass = (scenario_rand() & 0x1F) + 45;
|
||||||
peep->path_check_optimisation = 0;
|
peep->PathCheckOptimisation = 0;
|
||||||
peep->interaction_ride_index = RIDE_ID_NULL;
|
peep->interaction_ride_index = RIDE_ID_NULL;
|
||||||
peep->type = PEEP_TYPE_GUEST;
|
peep->type = PEEP_TYPE_GUEST;
|
||||||
peep->previous_ride = RIDE_ID_NULL;
|
peep->previous_ride = RIDE_ID_NULL;
|
||||||
|
@ -1754,14 +1754,14 @@ Peep* Peep::Generate(const CoordsXYZ& coords)
|
||||||
peep->cash_in_pocket = cash;
|
peep->cash_in_pocket = cash;
|
||||||
peep->cash_spent = 0;
|
peep->cash_spent = 0;
|
||||||
peep->time_in_park = -1;
|
peep->time_in_park = -1;
|
||||||
peep->pathfind_goal.x = 0xFF;
|
peep->PathfindGoal.x = 0xFF;
|
||||||
peep->pathfind_goal.y = 0xFF;
|
peep->PathfindGoal.y = 0xFF;
|
||||||
peep->pathfind_goal.z = 0xFF;
|
peep->PathfindGoal.z = 0xFF;
|
||||||
peep->pathfind_goal.direction = INVALID_DIRECTION;
|
peep->PathfindGoal.direction = INVALID_DIRECTION;
|
||||||
peep->ItemStandardFlags = 0;
|
peep->ItemStandardFlags = 0;
|
||||||
peep->item_extra_flags = 0;
|
peep->item_extra_flags = 0;
|
||||||
peep->guest_heading_to_ride_id = RIDE_ID_NULL;
|
peep->GuestHeadingToRideId = RIDE_ID_NULL;
|
||||||
peep->litter_count = 0;
|
peep->LitterCount = 0;
|
||||||
peep->DisgustingCount = 0;
|
peep->DisgustingCount = 0;
|
||||||
peep->VandalismSeen = 0;
|
peep->VandalismSeen = 0;
|
||||||
peep->PaidToEnter = 0;
|
peep->PaidToEnter = 0;
|
||||||
|
@ -1841,9 +1841,9 @@ void Peep::FormatActionTo(void* argsV) const
|
||||||
}
|
}
|
||||||
case PEEP_STATE_WALKING:
|
case PEEP_STATE_WALKING:
|
||||||
case PEEP_STATE_USING_BIN:
|
case PEEP_STATE_USING_BIN:
|
||||||
if (guest_heading_to_ride_id != RIDE_ID_NULL)
|
if (GuestHeadingToRideId != RIDE_ID_NULL)
|
||||||
{
|
{
|
||||||
auto ride = get_ride(guest_heading_to_ride_id);
|
auto ride = get_ride(GuestHeadingToRideId);
|
||||||
if (ride != nullptr)
|
if (ride != nullptr)
|
||||||
{
|
{
|
||||||
ft.Add<rct_string_id>(STR_HEADING_FOR);
|
ft.Add<rct_string_id>(STR_HEADING_FOR);
|
||||||
|
@ -1852,7 +1852,7 @@ void Peep::FormatActionTo(void* argsV) const
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ft.Add<rct_string_id>((peep_flags & PEEP_FLAGS_LEAVING_PARK) ? STR_LEAVING_PARK : STR_WALKING);
|
ft.Add<rct_string_id>((PeepFlags & PEEP_FLAGS_LEAVING_PARK) ? STR_LEAVING_PARK : STR_WALKING);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PEEP_STATE_QUEUING_FRONT:
|
case PEEP_STATE_QUEUING_FRONT:
|
||||||
|
@ -2228,7 +2228,7 @@ void peep_set_map_tooltip(Peep* peep)
|
||||||
auto ft = Formatter::MapTooltip();
|
auto ft = Formatter::MapTooltip();
|
||||||
if (peep->type == PEEP_TYPE_GUEST)
|
if (peep->type == PEEP_TYPE_GUEST)
|
||||||
{
|
{
|
||||||
ft.Add<rct_string_id>((peep->peep_flags & PEEP_FLAGS_TRACKING) ? STR_TRACKED_GUEST_MAP_TIP : STR_GUEST_MAP_TIP);
|
ft.Add<rct_string_id>((peep->PeepFlags & PEEP_FLAGS_TRACKING) ? STR_TRACKED_GUEST_MAP_TIP : STR_GUEST_MAP_TIP);
|
||||||
ft.Add<uint32_t>(get_peep_face_sprite_small(peep));
|
ft.Add<uint32_t>(get_peep_face_sprite_small(peep));
|
||||||
peep->FormatNameTo(ft);
|
peep->FormatNameTo(ft);
|
||||||
peep->FormatActionTo(ft);
|
peep->FormatActionTo(ft);
|
||||||
|
@ -2439,7 +2439,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
|
||||||
peep->SetState(PEEP_STATE_QUEUING);
|
peep->SetState(PEEP_STATE_QUEUING);
|
||||||
peep->sub_state = 11;
|
peep->sub_state = 11;
|
||||||
peep->time_in_queue = 0;
|
peep->time_in_queue = 0;
|
||||||
if (peep->peep_flags & PEEP_FLAGS_TRACKING)
|
if (peep->PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
{
|
{
|
||||||
auto ft = Formatter::Common();
|
auto ft = Formatter::Common();
|
||||||
peep->FormatNameTo(ft);
|
peep->FormatNameTo(ft);
|
||||||
|
@ -2484,7 +2484,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(peep->peep_flags & PEEP_FLAGS_LEAVING_PARK))
|
if (!(peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK))
|
||||||
{
|
{
|
||||||
// If the park is open and leaving flag isn't set return to centre
|
// If the park is open and leaving flag isn't set return to centre
|
||||||
if (gParkFlags & PARK_FLAGS_PARK_OPEN)
|
if (gParkFlags & PARK_FLAGS_PARK_OPEN)
|
||||||
|
@ -2501,7 +2501,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
|
||||||
peep->SetState(PEEP_STATE_LEAVING_PARK);
|
peep->SetState(PEEP_STATE_LEAVING_PARK);
|
||||||
|
|
||||||
peep->var_37 = 0;
|
peep->var_37 = 0;
|
||||||
if (peep->peep_flags & PEEP_FLAGS_TRACKING)
|
if (peep->PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
{
|
{
|
||||||
auto ft = Formatter::Common();
|
auto ft = Formatter::Common();
|
||||||
peep->FormatNameTo(ft);
|
peep->FormatNameTo(ft);
|
||||||
|
@ -2628,7 +2628,7 @@ static void peep_interact_with_entrance(Peep* peep, int16_t x, int16_t y, TileEl
|
||||||
|
|
||||||
gTotalIncomeFromAdmissions += entranceFee;
|
gTotalIncomeFromAdmissions += entranceFee;
|
||||||
guest->SpendMoney(peep->PaidToEnter, entranceFee, ExpenditureType::ParkEntranceTickets);
|
guest->SpendMoney(peep->PaidToEnter, entranceFee, ExpenditureType::ParkEntranceTickets);
|
||||||
peep->peep_flags |= PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY;
|
peep->PeepFlags |= PEEP_FLAGS_HAS_PAID_FOR_PARK_ENTRY;
|
||||||
}
|
}
|
||||||
|
|
||||||
gTotalAdmissions++;
|
gTotalAdmissions++;
|
||||||
|
@ -2753,14 +2753,14 @@ static void peep_footpath_move_forward(Peep* peep, int16_t x, int16_t y, TileEle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t litter_time = peep->litter_count & 0xC0;
|
uint8_t litter_time = peep->LitterCount & 0xC0;
|
||||||
litter_count = ((peep->litter_count & 0xF) << 2) | litter_count;
|
litter_count = ((peep->LitterCount & 0xF) << 2) | litter_count;
|
||||||
peep->litter_count = litter_count | litter_time;
|
peep->LitterCount = litter_count | litter_time;
|
||||||
|
|
||||||
if (litter_time & 0xC0 && (scenario_rand() & 0xFFFF) <= 4369)
|
if (litter_time & 0xC0 && (scenario_rand() & 0xFFFF) <= 4369)
|
||||||
{
|
{
|
||||||
// Reduce the litter time
|
// Reduce the litter time
|
||||||
peep->litter_count -= 0x40;
|
peep->LitterCount -= 0x40;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2775,7 +2775,7 @@ static void peep_footpath_move_forward(Peep* peep, int16_t x, int16_t y, TileEle
|
||||||
peep->InsertNewThought(PEEP_THOUGHT_TYPE_BAD_LITTER, PEEP_THOUGHT_ITEM_NONE);
|
peep->InsertNewThought(PEEP_THOUGHT_TYPE_BAD_LITTER, PEEP_THOUGHT_ITEM_NONE);
|
||||||
peep->happiness_target = std::max(0, peep->happiness_target - 17);
|
peep->happiness_target = std::max(0, peep->happiness_target - 17);
|
||||||
// Reset litter time
|
// Reset litter time
|
||||||
peep->litter_count |= 0xC0;
|
peep->LitterCount |= 0xC0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2871,7 +2871,7 @@ static void peep_interact_with_path(Peep* peep, int16_t x, int16_t y, TileElemen
|
||||||
peep->sub_state = 10;
|
peep->sub_state = 10;
|
||||||
peep->destination_tolerance = 2;
|
peep->destination_tolerance = 2;
|
||||||
peep->time_in_queue = 0;
|
peep->time_in_queue = 0;
|
||||||
if (peep->peep_flags & PEEP_FLAGS_TRACKING)
|
if (peep->PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
{
|
{
|
||||||
auto ft = Formatter::Common();
|
auto ft = Formatter::Common();
|
||||||
peep->FormatNameTo(ft);
|
peep->FormatNameTo(ft);
|
||||||
|
@ -2943,7 +2943,7 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (peep->peep_flags & PEEP_FLAGS_LEAVING_PARK)
|
if (peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||||
{
|
{
|
||||||
peep_return_to_centre_of_tile(peep);
|
peep_return_to_centre_of_tile(peep);
|
||||||
return true;
|
return true;
|
||||||
|
@ -2976,9 +2976,9 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen
|
||||||
peep->SetState(PEEP_STATE_ENTERING_RIDE);
|
peep->SetState(PEEP_STATE_ENTERING_RIDE);
|
||||||
peep->sub_state = PEEP_SHOP_APPROACH;
|
peep->sub_state = PEEP_SHOP_APPROACH;
|
||||||
|
|
||||||
peep->time_on_ride = 0;
|
peep->GuestTimeOnRide = 0;
|
||||||
ride->cur_num_customers++;
|
ride->cur_num_customers++;
|
||||||
if (peep->peep_flags & PEEP_FLAGS_TRACKING)
|
if (peep->PeepFlags & PEEP_FLAGS_TRACKING)
|
||||||
{
|
{
|
||||||
auto ft = Formatter::Common();
|
auto ft = Formatter::Common();
|
||||||
peep->FormatNameTo(ft);
|
peep->FormatNameTo(ft);
|
||||||
|
@ -2993,8 +2993,8 @@ static bool peep_interact_with_shop(Peep* peep, int16_t x, int16_t y, TileElemen
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (peep->guest_heading_to_ride_id == rideIndex)
|
if (peep->GuestHeadingToRideId == rideIndex)
|
||||||
peep->guest_heading_to_ride_id = 0xFF;
|
peep->GuestHeadingToRideId = 0xFF;
|
||||||
peep->action_sprite_image_offset = _unk_F1AEF0;
|
peep->action_sprite_image_offset = _unk_F1AEF0;
|
||||||
peep->SetState(PEEP_STATE_BUYING);
|
peep->SetState(PEEP_STATE_BUYING);
|
||||||
peep->current_ride = rideIndex;
|
peep->current_ride = rideIndex;
|
||||||
|
@ -3170,7 +3170,7 @@ void Peep::PerformNextAction(uint8_t& pathing_result, TileElement*& tile_result)
|
||||||
if (type == PEEP_TYPE_STAFF && !GetNextIsSurface())
|
if (type == PEEP_TYPE_STAFF && !GetNextIsSurface())
|
||||||
{
|
{
|
||||||
// Prevent staff from leaving the path on their own unless they're allowed to mow.
|
// Prevent staff from leaving the path on their own unless they're allowed to mow.
|
||||||
if (!((this->staff_orders & STAFF_ORDERS_MOWING) && this->staff_mowing_timeout >= 12))
|
if (!((this->StaffOrders & STAFF_ORDERS_MOWING) && this->StaffMowingTimeout >= 12))
|
||||||
{
|
{
|
||||||
peep_return_to_centre_of_tile(this);
|
peep_return_to_centre_of_tile(this);
|
||||||
return;
|
return;
|
||||||
|
@ -3199,14 +3199,14 @@ void peep_reset_pathfind_goal(Peep* peep)
|
||||||
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
#if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||||
if (gPathFindDebug)
|
if (gPathFindDebug)
|
||||||
{
|
{
|
||||||
log_info("Resetting pathfind_goal for %s", gPathFindDebugPeepName);
|
log_info("Resetting PathfindGoal for %s", gPathFindDebugPeepName);
|
||||||
}
|
}
|
||||||
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
#endif // defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1
|
||||||
|
|
||||||
peep->pathfind_goal.x = 0xFF;
|
peep->PathfindGoal.x = 0xFF;
|
||||||
peep->pathfind_goal.y = 0xFF;
|
peep->PathfindGoal.y = 0xFF;
|
||||||
peep->pathfind_goal.z = 0xFF;
|
peep->PathfindGoal.z = 0xFF;
|
||||||
peep->pathfind_goal.direction = INVALID_DIRECTION;
|
peep->PathfindGoal.direction = INVALID_DIRECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -3322,7 +3322,7 @@ void pathfind_logging_enable([[maybe_unused]] Peep* peep)
|
||||||
* be output for. */
|
* be output for. */
|
||||||
if (peep->type == PEEP_TYPE_GUEST)
|
if (peep->type == PEEP_TYPE_GUEST)
|
||||||
{
|
{
|
||||||
gPathFindDebug = peep->peep_flags & PEEP_FLAGS_TRACKING;
|
gPathFindDebug = peep->PeepFlags & PEEP_FLAGS_TRACKING;
|
||||||
}
|
}
|
||||||
/* For staff, there is no tracking button (any other similar
|
/* For staff, there is no tracking button (any other similar
|
||||||
* suitable existing mechanism?), so fall back to a crude
|
* suitable existing mechanism?), so fall back to a crude
|
||||||
|
|
|
@ -521,7 +521,7 @@ enum PeepInvalidate
|
||||||
PEEP_INVALIDATE_PEEP_2 = 1 << 2,
|
PEEP_INVALIDATE_PEEP_2 = 1 << 2,
|
||||||
PEEP_INVALIDATE_PEEP_INVENTORY = 1 << 3,
|
PEEP_INVALIDATE_PEEP_INVENTORY = 1 << 3,
|
||||||
PEEP_INVALIDATE_STAFF_STATS = 1 << 4,
|
PEEP_INVALIDATE_STAFF_STATS = 1 << 4,
|
||||||
PEEP_INVALIDATE_PEEP_ACTION = 1 << 5, // Currently set only when guest_heading_to_ride_id is changed
|
PEEP_INVALIDATE_PEEP_ACTION = 1 << 5, // Currently set only when GuestHeadingToRideId is changed
|
||||||
};
|
};
|
||||||
|
|
||||||
// Flags used by peep_should_go_on_ride()
|
// Flags used by peep_should_go_on_ride()
|
||||||
|
@ -685,28 +685,28 @@ struct Peep : SpriteBase
|
||||||
uint8_t previous_ride;
|
uint8_t previous_ride;
|
||||||
uint16_t previous_ride_time_out;
|
uint16_t previous_ride_time_out;
|
||||||
rct_peep_thought thoughts[PEEP_MAX_THOUGHTS];
|
rct_peep_thought thoughts[PEEP_MAX_THOUGHTS];
|
||||||
uint8_t path_check_optimisation; // see peep.checkForPath
|
uint8_t PathCheckOptimisation; // see peep.checkForPath
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
uint8_t staff_id;
|
uint8_t StaffId;
|
||||||
uint8_t guest_heading_to_ride_id;
|
uint8_t GuestHeadingToRideId;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
uint8_t staff_orders;
|
uint8_t StaffOrders;
|
||||||
uint8_t peep_is_lost_countdown;
|
uint8_t GuestIsLostCountdown;
|
||||||
};
|
};
|
||||||
uint8_t photo1_ride_ref;
|
uint8_t Photo1RideRef;
|
||||||
uint32_t peep_flags;
|
uint32_t PeepFlags;
|
||||||
rct12_xyzd8 pathfind_goal;
|
rct12_xyzd8 PathfindGoal;
|
||||||
rct12_xyzd8 pathfind_history[4];
|
rct12_xyzd8 PathfindHistory[4];
|
||||||
uint8_t no_action_frame_num;
|
uint8_t WalkingFrameNum;
|
||||||
// 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc
|
// 0x3F Litter Count split into lots of 3 with time, 0xC0 Time since last recalc
|
||||||
uint8_t litter_count;
|
uint8_t LitterCount;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
uint8_t time_on_ride;
|
uint8_t GuestTimeOnRide;
|
||||||
uint8_t staff_mowing_timeout;
|
uint8_t StaffMowingTimeout;
|
||||||
};
|
};
|
||||||
// 0x3F Sick Count split into lots of 3 with time, 0xC0 Time since last recalc
|
// 0x3F Sick Count split into lots of 3 with time, 0xC0 Time since last recalc
|
||||||
uint8_t DisgustingCount;
|
uint8_t DisgustingCount;
|
||||||
|
|
|
@ -70,7 +70,7 @@ const rct_string_id StaffCostumeNames[] = {
|
||||||
};
|
};
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
// Every staff member has STAFF_PATROL_AREA_SIZE elements assigned to in this array, indexed by their staff_id
|
// Every staff member has STAFF_PATROL_AREA_SIZE elements assigned to in this array, indexed by their StaffId
|
||||||
// Additionally there is a patrol area for each staff type, which is the union of the patrols of all staff members of that type
|
// Additionally there is a patrol area for each staff type, which is the union of the patrols of all staff members of that type
|
||||||
uint32_t gStaffPatrolAreas[(STAFF_MAX_COUNT + STAFF_TYPE_COUNT) * STAFF_PATROL_AREA_SIZE];
|
uint32_t gStaffPatrolAreas[(STAFF_MAX_COUNT + STAFF_TYPE_COUNT) * STAFF_PATROL_AREA_SIZE];
|
||||||
uint8_t gStaffModes[STAFF_MAX_COUNT + STAFF_TYPE_COUNT];
|
uint8_t gStaffModes[STAFF_MAX_COUNT + STAFF_TYPE_COUNT];
|
||||||
|
@ -157,7 +157,7 @@ void staff_update_greyed_patrol_areas()
|
||||||
{
|
{
|
||||||
if (peep->staff_type == staff_type)
|
if (peep->staff_type == staff_type)
|
||||||
{
|
{
|
||||||
int32_t peepPatrolOffset = peep->staff_id * STAFF_PATROL_AREA_SIZE;
|
int32_t peepPatrolOffset = peep->StaffId * STAFF_PATROL_AREA_SIZE;
|
||||||
for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++)
|
for (int32_t i = 0; i < STAFF_PATROL_AREA_SIZE; i++)
|
||||||
{
|
{
|
||||||
gStaffPatrolAreas[staffPatrolOffset + i] |= gStaffPatrolAreas[peepPatrolOffset + i];
|
gStaffPatrolAreas[staffPatrolOffset + i] |= gStaffPatrolAreas[peepPatrolOffset + i];
|
||||||
|
@ -178,7 +178,7 @@ bool Staff::IsLocationInPatrol(const CoordsXY& loc) const
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check if staff has patrol area
|
// Check if staff has patrol area
|
||||||
if (!(gStaffModes[staff_id] & 2))
|
if (!(gStaffModes[StaffId] & 2))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return IsPatrolAreaSet(loc);
|
return IsPatrolAreaSet(loc);
|
||||||
|
@ -395,7 +395,7 @@ static bool staff_is_patrol_area_set(int32_t staffIndex, int32_t x, int32_t y)
|
||||||
|
|
||||||
bool Staff::IsPatrolAreaSet(const CoordsXY& coords) const
|
bool Staff::IsPatrolAreaSet(const CoordsXY& coords) const
|
||||||
{
|
{
|
||||||
return staff_is_patrol_area_set(staff_id, coords.x, coords.y);
|
return staff_is_patrol_area_set(StaffId, coords.x, coords.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool staff_is_patrol_area_set_for_type(STAFF_TYPE type, const CoordsXY& coords)
|
bool staff_is_patrol_area_set_for_type(STAFF_TYPE type, const CoordsXY& coords)
|
||||||
|
@ -611,18 +611,18 @@ int32_t Staff::HandymanDirectionRandSurface(uint8_t validDirections)
|
||||||
*/
|
*/
|
||||||
bool Staff::DoHandymanPathFinding()
|
bool Staff::DoHandymanPathFinding()
|
||||||
{
|
{
|
||||||
staff_mowing_timeout++;
|
StaffMowingTimeout++;
|
||||||
|
|
||||||
uint8_t litterDirection = INVALID_DIRECTION;
|
uint8_t litterDirection = INVALID_DIRECTION;
|
||||||
uint8_t validDirections = staff_get_valid_patrol_directions(this, NextLoc);
|
uint8_t validDirections = staff_get_valid_patrol_directions(this, NextLoc);
|
||||||
|
|
||||||
if ((staff_orders & STAFF_ORDERS_SWEEPING) && ((gCurrentTicks + sprite_index) & 0xFFF) > 110)
|
if ((StaffOrders & STAFF_ORDERS_SWEEPING) && ((gCurrentTicks + sprite_index) & 0xFFF) > 110)
|
||||||
{
|
{
|
||||||
litterDirection = staff_handyman_direction_to_nearest_litter(this);
|
litterDirection = staff_handyman_direction_to_nearest_litter(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Direction newDirection = INVALID_DIRECTION;
|
Direction newDirection = INVALID_DIRECTION;
|
||||||
if (litterDirection == INVALID_DIRECTION && (staff_orders & STAFF_ORDERS_MOWING) && staff_mowing_timeout >= 12)
|
if (litterDirection == INVALID_DIRECTION && (StaffOrders & STAFF_ORDERS_MOWING) && StaffMowingTimeout >= 12)
|
||||||
{
|
{
|
||||||
newDirection = staff_handyman_direction_to_uncut_grass(this, validDirections);
|
newDirection = staff_handyman_direction_to_uncut_grass(this, validDirections);
|
||||||
}
|
}
|
||||||
|
@ -875,7 +875,7 @@ static uint8_t staff_mechanic_direction_path(Peep* peep, uint8_t validDirections
|
||||||
if (pathfindDirection == INVALID_DIRECTION)
|
if (pathfindDirection == INVALID_DIRECTION)
|
||||||
{
|
{
|
||||||
/* Heuristic search failed for all directions.
|
/* Heuristic search failed for all directions.
|
||||||
* Reset the pathfind_goal - this means that the pathfind_history
|
* Reset the PathfindGoal - this means that the PathfindHistory
|
||||||
* will be reset in the next call to peep_pathfind_choose_direction().
|
* will be reset in the next call to peep_pathfind_choose_direction().
|
||||||
* This lets the heuristic search "try again" in case the player has
|
* This lets the heuristic search "try again" in case the player has
|
||||||
* edited the path layout or the mechanic was already stuck in the
|
* edited the path layout or the mechanic was already stuck in the
|
||||||
|
@ -1242,7 +1242,7 @@ void Staff::UpdateMowing()
|
||||||
*/
|
*/
|
||||||
void Staff::UpdateWatering()
|
void Staff::UpdateWatering()
|
||||||
{
|
{
|
||||||
staff_mowing_timeout = 0;
|
StaffMowingTimeout = 0;
|
||||||
if (sub_state == 0)
|
if (sub_state == 0)
|
||||||
{
|
{
|
||||||
if (!CheckForPath())
|
if (!CheckForPath())
|
||||||
|
@ -1305,7 +1305,7 @@ void Staff::UpdateWatering()
|
||||||
*/
|
*/
|
||||||
void Staff::UpdateEmptyingBin()
|
void Staff::UpdateEmptyingBin()
|
||||||
{
|
{
|
||||||
staff_mowing_timeout = 0;
|
StaffMowingTimeout = 0;
|
||||||
|
|
||||||
if (sub_state == 0)
|
if (sub_state == 0)
|
||||||
{
|
{
|
||||||
|
@ -1386,7 +1386,7 @@ void Staff::UpdateEmptyingBin()
|
||||||
*/
|
*/
|
||||||
void Staff::UpdateSweeping()
|
void Staff::UpdateSweeping()
|
||||||
{
|
{
|
||||||
staff_mowing_timeout = 0;
|
StaffMowingTimeout = 0;
|
||||||
if (!CheckForPath())
|
if (!CheckForPath())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1645,7 +1645,7 @@ static constexpr const CoordsXY _WateringUseOffsets[] = {
|
||||||
*/
|
*/
|
||||||
static int32_t peep_update_patrolling_find_watering(Peep* peep)
|
static int32_t peep_update_patrolling_find_watering(Peep* peep)
|
||||||
{
|
{
|
||||||
if (!(peep->staff_orders & STAFF_ORDERS_WATER_FLOWERS))
|
if (!(peep->StaffOrders & STAFF_ORDERS_WATER_FLOWERS))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint8_t chosen_position = scenario_rand() & 7;
|
uint8_t chosen_position = scenario_rand() & 7;
|
||||||
|
@ -1717,7 +1717,7 @@ static int32_t peep_update_patrolling_find_watering(Peep* peep)
|
||||||
*/
|
*/
|
||||||
static int32_t peep_update_patrolling_find_bin(Peep* peep)
|
static int32_t peep_update_patrolling_find_bin(Peep* peep)
|
||||||
{
|
{
|
||||||
if (!(peep->staff_orders & STAFF_ORDERS_EMPTY_BINS))
|
if (!(peep->StaffOrders & STAFF_ORDERS_EMPTY_BINS))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (peep->GetNextIsSurface())
|
if (peep->GetNextIsSurface())
|
||||||
|
@ -1782,10 +1782,10 @@ static int32_t peep_update_patrolling_find_bin(Peep* peep)
|
||||||
*/
|
*/
|
||||||
static int32_t peep_update_patrolling_find_grass(Peep* peep)
|
static int32_t peep_update_patrolling_find_grass(Peep* peep)
|
||||||
{
|
{
|
||||||
if (!(peep->staff_orders & STAFF_ORDERS_MOWING))
|
if (!(peep->StaffOrders & STAFF_ORDERS_MOWING))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (peep->staff_mowing_timeout < 12)
|
if (peep->StaffMowingTimeout < 12)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!(peep->GetNextIsSurface()))
|
if (!(peep->GetNextIsSurface()))
|
||||||
|
@ -1814,7 +1814,7 @@ static int32_t peep_update_patrolling_find_grass(Peep* peep)
|
||||||
*/
|
*/
|
||||||
static int32_t peep_update_patrolling_find_sweeping(Peep* peep)
|
static int32_t peep_update_patrolling_find_sweeping(Peep* peep)
|
||||||
{
|
{
|
||||||
if (!(peep->staff_orders & STAFF_ORDERS_SWEEPING))
|
if (!(peep->StaffOrders & STAFF_ORDERS_SWEEPING))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
uint16_t sprite_id = sprite_get_first_in_quadrant(peep->x, peep->y);
|
uint16_t sprite_id = sprite_get_first_in_quadrant(peep->x, peep->y);
|
||||||
|
@ -1856,14 +1856,14 @@ void Staff::Tick128UpdateStaff()
|
||||||
|
|
||||||
sprite_type = newSpriteType;
|
sprite_type = newSpriteType;
|
||||||
action_sprite_image_offset = 0;
|
action_sprite_image_offset = 0;
|
||||||
no_action_frame_num = 0;
|
WalkingFrameNum = 0;
|
||||||
if (action < PEEP_ACTION_NONE_1)
|
if (action < PEEP_ACTION_NONE_1)
|
||||||
action = PEEP_ACTION_NONE_2;
|
action = PEEP_ACTION_NONE_2;
|
||||||
|
|
||||||
peep_flags &= ~PEEP_FLAGS_SLOW_WALK;
|
PeepFlags &= ~PEEP_FLAGS_SLOW_WALK;
|
||||||
if (gSpriteTypeToSlowWalkMap[newSpriteType])
|
if (gSpriteTypeToSlowWalkMap[newSpriteType])
|
||||||
{
|
{
|
||||||
peep_flags |= PEEP_FLAGS_SLOW_WALK;
|
PeepFlags |= PEEP_FLAGS_SLOW_WALK;
|
||||||
}
|
}
|
||||||
|
|
||||||
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID;
|
action_sprite_type = PEEP_ACTION_SPRITE_TYPE_INVALID;
|
||||||
|
|
|
@ -1395,7 +1395,7 @@ private:
|
||||||
dst->special_sprite = src->special_sprite;
|
dst->special_sprite = src->special_sprite;
|
||||||
dst->next_action_sprite_type = static_cast<PeepActionSpriteType>(src->next_action_sprite_type);
|
dst->next_action_sprite_type = static_cast<PeepActionSpriteType>(src->next_action_sprite_type);
|
||||||
dst->action_sprite_image_offset = src->action_sprite_image_offset;
|
dst->action_sprite_image_offset = src->action_sprite_image_offset;
|
||||||
dst->no_action_frame_num = src->no_action_frame_num;
|
dst->WalkingFrameNum = src->no_action_frame_num;
|
||||||
dst->action_sprite_type = static_cast<PeepActionSpriteType>(src->action_sprite_type);
|
dst->action_sprite_type = static_cast<PeepActionSpriteType>(src->action_sprite_type);
|
||||||
dst->action_frame = src->action_frame;
|
dst->action_frame = src->action_frame;
|
||||||
|
|
||||||
|
@ -1459,7 +1459,7 @@ private:
|
||||||
dst->toilet = src->toilet;
|
dst->toilet = src->toilet;
|
||||||
dst->mass = src->mass;
|
dst->mass = src->mass;
|
||||||
|
|
||||||
dst->litter_count = src->litter_count;
|
dst->LitterCount = src->litter_count;
|
||||||
dst->DisgustingCount = src->disgusting_count;
|
dst->DisgustingCount = src->disgusting_count;
|
||||||
|
|
||||||
dst->intensity = static_cast<IntensityRange>(src->intensity);
|
dst->intensity = static_cast<IntensityRange>(src->intensity);
|
||||||
|
@ -1471,7 +1471,7 @@ private:
|
||||||
dst->current_train = src->current_train;
|
dst->current_train = src->current_train;
|
||||||
dst->current_car = src->current_car;
|
dst->current_car = src->current_car;
|
||||||
dst->current_seat = src->current_seat;
|
dst->current_seat = src->current_seat;
|
||||||
dst->time_on_ride = src->time_on_ride;
|
dst->GuestTimeOnRide = src->time_on_ride;
|
||||||
dst->DaysInQueue = src->days_in_queue;
|
dst->DaysInQueue = src->days_in_queue;
|
||||||
|
|
||||||
dst->interaction_ride_index = src->interaction_ride_index;
|
dst->interaction_ride_index = src->interaction_ride_index;
|
||||||
|
@ -1510,7 +1510,7 @@ private:
|
||||||
dst->ride_types_been_on[i] = src->ride_types_been_on[i];
|
dst->ride_types_been_on[i] = src->ride_types_been_on[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
dst->photo1_ride_ref = src->photo1_ride_ref;
|
dst->Photo1RideRef = src->photo1_ride_ref;
|
||||||
|
|
||||||
for (size_t i = 0; i < std::size(src->thoughts); i++)
|
for (size_t i = 0; i < std::size(src->thoughts); i++)
|
||||||
{
|
{
|
||||||
|
@ -1525,18 +1525,18 @@ private:
|
||||||
dst->previous_ride = src->previous_ride;
|
dst->previous_ride = src->previous_ride;
|
||||||
dst->previous_ride_time_out = src->previous_ride_time_out;
|
dst->previous_ride_time_out = src->previous_ride_time_out;
|
||||||
|
|
||||||
dst->path_check_optimisation = 0;
|
dst->PathCheckOptimisation = 0;
|
||||||
dst->guest_heading_to_ride_id = src->guest_heading_to_ride_id;
|
dst->GuestHeadingToRideId = src->guest_heading_to_ride_id;
|
||||||
// Doubles as staff orders
|
// Doubles as staff orders
|
||||||
dst->peep_is_lost_countdown = src->peep_is_lost_countdown;
|
dst->GuestIsLostCountdown = src->peep_is_lost_countdown;
|
||||||
// The ID is fixed later
|
// The ID is fixed later
|
||||||
dst->next_in_queue = src->next_in_queue;
|
dst->next_in_queue = src->next_in_queue;
|
||||||
|
|
||||||
dst->peep_flags = 0;
|
dst->PeepFlags = 0;
|
||||||
dst->pathfind_goal.x = 0xFF;
|
dst->PathfindGoal.x = 0xFF;
|
||||||
dst->pathfind_goal.y = 0xFF;
|
dst->PathfindGoal.y = 0xFF;
|
||||||
dst->pathfind_goal.z = 0xFF;
|
dst->PathfindGoal.z = 0xFF;
|
||||||
dst->pathfind_goal.direction = INVALID_DIRECTION;
|
dst->PathfindGoal.direction = INVALID_DIRECTION;
|
||||||
|
|
||||||
// Guests' favourite ride was only saved in LL.
|
// Guests' favourite ride was only saved in LL.
|
||||||
// Set it to N/A if the save comes from the original or AA.
|
// Set it to N/A if the save comes from the original or AA.
|
||||||
|
@ -1596,7 +1596,7 @@ private:
|
||||||
// index in the array ----^ ^--- bit position in the 8-bit value
|
// index in the array ----^ ^--- bit position in the 8-bit value
|
||||||
// We do the opposite in this function to recover the x and y values.
|
// We do the opposite in this function to recover the x and y values.
|
||||||
|
|
||||||
int32_t peepOffset = staffmember->staff_id * RCT12_PATROL_AREA_SIZE;
|
int32_t peepOffset = staffmember->StaffId * RCT12_PATROL_AREA_SIZE;
|
||||||
for (int32_t i = 0; i < RCT12_PATROL_AREA_SIZE; i++)
|
for (int32_t i = 0; i < RCT12_PATROL_AREA_SIZE; i++)
|
||||||
{
|
{
|
||||||
if (_s4.patrol_areas[peepOffset + i] == 0)
|
if (_s4.patrol_areas[peepOffset + i] == 0)
|
||||||
|
@ -1620,7 +1620,7 @@ private:
|
||||||
x <<= 7;
|
x <<= 7;
|
||||||
int32_t y = val & 0x3E0;
|
int32_t y = val & 0x3E0;
|
||||||
y <<= 2;
|
y <<= 2;
|
||||||
staff_set_patrol_area(staffmember->staff_id, x, y, true);
|
staff_set_patrol_area(staffmember->StaffId, x, y, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1207,19 +1207,19 @@ void S6Exporter::ExportSpritePeep(RCT2SpritePeep* dst, const Peep* src)
|
||||||
dstThought->freshness = srcThought->freshness;
|
dstThought->freshness = srcThought->freshness;
|
||||||
dstThought->fresh_timeout = srcThought->fresh_timeout;
|
dstThought->fresh_timeout = srcThought->fresh_timeout;
|
||||||
}
|
}
|
||||||
dst->path_check_optimisation = src->path_check_optimisation;
|
dst->path_check_optimisation = src->PathCheckOptimisation;
|
||||||
dst->guest_heading_to_ride_id = src->guest_heading_to_ride_id;
|
dst->guest_heading_to_ride_id = src->GuestHeadingToRideId;
|
||||||
dst->peep_is_lost_countdown = src->peep_is_lost_countdown;
|
dst->peep_is_lost_countdown = src->GuestIsLostCountdown;
|
||||||
dst->photo1_ride_ref = src->photo1_ride_ref;
|
dst->photo1_ride_ref = src->Photo1RideRef;
|
||||||
dst->peep_flags = src->peep_flags;
|
dst->peep_flags = src->PeepFlags;
|
||||||
dst->pathfind_goal = src->pathfind_goal;
|
dst->pathfind_goal = src->PathfindGoal;
|
||||||
for (size_t i = 0; i < std::size(src->pathfind_history); i++)
|
for (size_t i = 0; i < std::size(src->PathfindHistory); i++)
|
||||||
{
|
{
|
||||||
dst->pathfind_history[i] = src->pathfind_history[i];
|
dst->pathfind_history[i] = src->PathfindHistory[i];
|
||||||
}
|
}
|
||||||
dst->no_action_frame_num = src->no_action_frame_num;
|
dst->no_action_frame_num = src->WalkingFrameNum;
|
||||||
dst->litter_count = src->litter_count;
|
dst->litter_count = src->LitterCount;
|
||||||
dst->time_on_ride = src->time_on_ride;
|
dst->time_on_ride = src->GuestTimeOnRide;
|
||||||
dst->disgusting_count = src->DisgustingCount;
|
dst->disgusting_count = src->DisgustingCount;
|
||||||
dst->paid_to_enter = src->PaidToEnter;
|
dst->paid_to_enter = src->PaidToEnter;
|
||||||
dst->paid_on_rides = src->PaidOnRides;
|
dst->paid_on_rides = src->PaidOnRides;
|
||||||
|
|
|
@ -1472,19 +1472,19 @@ public:
|
||||||
dstThought->freshness = srcThought->freshness;
|
dstThought->freshness = srcThought->freshness;
|
||||||
dstThought->fresh_timeout = srcThought->fresh_timeout;
|
dstThought->fresh_timeout = srcThought->fresh_timeout;
|
||||||
}
|
}
|
||||||
dst->path_check_optimisation = src->path_check_optimisation;
|
dst->PathCheckOptimisation = src->path_check_optimisation;
|
||||||
dst->guest_heading_to_ride_id = src->guest_heading_to_ride_id;
|
dst->GuestHeadingToRideId = src->guest_heading_to_ride_id;
|
||||||
dst->peep_is_lost_countdown = src->peep_is_lost_countdown;
|
dst->GuestIsLostCountdown = src->peep_is_lost_countdown;
|
||||||
dst->photo1_ride_ref = src->photo1_ride_ref;
|
dst->Photo1RideRef = src->photo1_ride_ref;
|
||||||
dst->peep_flags = src->peep_flags;
|
dst->PeepFlags = src->peep_flags;
|
||||||
dst->pathfind_goal = src->pathfind_goal;
|
dst->PathfindGoal = src->pathfind_goal;
|
||||||
for (size_t i = 0; i < std::size(src->pathfind_history); i++)
|
for (size_t i = 0; i < std::size(src->pathfind_history); i++)
|
||||||
{
|
{
|
||||||
dst->pathfind_history[i] = src->pathfind_history[i];
|
dst->PathfindHistory[i] = src->pathfind_history[i];
|
||||||
}
|
}
|
||||||
dst->no_action_frame_num = src->no_action_frame_num;
|
dst->WalkingFrameNum = src->no_action_frame_num;
|
||||||
dst->litter_count = src->litter_count;
|
dst->LitterCount = src->litter_count;
|
||||||
dst->time_on_ride = src->time_on_ride;
|
dst->GuestTimeOnRide = src->time_on_ride;
|
||||||
dst->DisgustingCount = src->disgusting_count;
|
dst->DisgustingCount = src->disgusting_count;
|
||||||
dst->PaidToEnter = src->paid_to_enter;
|
dst->PaidToEnter = src->paid_to_enter;
|
||||||
dst->PaidOnRides = src->paid_on_rides;
|
dst->PaidOnRides = src->paid_on_rides;
|
||||||
|
|
|
@ -2706,12 +2706,12 @@ Peep* find_closest_mechanic(int32_t x, int32_t y, int32_t forInspection)
|
||||||
else if (peep->state != PEEP_STATE_PATROLLING)
|
else if (peep->state != PEEP_STATE_PATROLLING)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!(peep->staff_orders & STAFF_ORDERS_FIX_RIDES))
|
if (!(peep->StaffOrders & STAFF_ORDERS_FIX_RIDES))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (peep->state != PEEP_STATE_PATROLLING || !(peep->staff_orders & STAFF_ORDERS_INSPECT_RIDES))
|
if (peep->state != PEEP_STATE_PATROLLING || !(peep->StaffOrders & STAFF_ORDERS_INSPECT_RIDES))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3048,7 +3048,7 @@ void Vehicle::PeepEasterEggHereWeAre() const
|
||||||
for (int32_t i = 0; i < vehicle->num_peeps; ++i)
|
for (int32_t i = 0; i < vehicle->num_peeps; ++i)
|
||||||
{
|
{
|
||||||
Peep* curPeep = GET_PEEP(vehicle->peep[i]);
|
Peep* curPeep = GET_PEEP(vehicle->peep[i]);
|
||||||
if (curPeep->peep_flags & PEEP_FLAGS_HERE_WE_ARE)
|
if (curPeep->PeepFlags & PEEP_FLAGS_HERE_WE_ARE)
|
||||||
{
|
{
|
||||||
curPeep->InsertNewThought(PEEP_THOUGHT_TYPE_HERE_WE_ARE, curPeep->current_ride);
|
curPeep->InsertNewThought(PEEP_THOUGHT_TYPE_HERE_WE_ARE, curPeep->current_ride);
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,7 @@ namespace OpenRCT2::Scripting
|
||||||
if (peep != nullptr)
|
if (peep != nullptr)
|
||||||
{
|
{
|
||||||
auto mask = PeepFlagMap[key];
|
auto mask = PeepFlagMap[key];
|
||||||
return (peep->peep_flags & mask) != 0;
|
return (peep->PeepFlags & mask) != 0;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -269,9 +269,9 @@ namespace OpenRCT2::Scripting
|
||||||
{
|
{
|
||||||
auto mask = PeepFlagMap[key];
|
auto mask = PeepFlagMap[key];
|
||||||
if (value)
|
if (value)
|
||||||
peep->peep_flags |= mask;
|
peep->PeepFlags |= mask;
|
||||||
else
|
else
|
||||||
peep->peep_flags &= ~mask;
|
peep->PeepFlags &= ~mask;
|
||||||
peep->Invalidate();
|
peep->Invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -756,7 +756,7 @@ namespace OpenRCT2::Scripting
|
||||||
uint8_t orders_get() const
|
uint8_t orders_get() const
|
||||||
{
|
{
|
||||||
auto peep = GetStaff();
|
auto peep = GetStaff();
|
||||||
return peep != nullptr ? peep->staff_orders : 0;
|
return peep != nullptr ? peep->StaffOrders : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void orders_set(uint8_t value)
|
void orders_set(uint8_t value)
|
||||||
|
@ -765,7 +765,7 @@ namespace OpenRCT2::Scripting
|
||||||
auto peep = GetStaff();
|
auto peep = GetStaff();
|
||||||
if (peep != nullptr)
|
if (peep != nullptr)
|
||||||
{
|
{
|
||||||
peep->staff_orders = value;
|
peep->StaffOrders = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -395,7 +395,7 @@ int32_t Park::CalculateParkRating() const
|
||||||
{
|
{
|
||||||
happyGuestCount++;
|
happyGuestCount++;
|
||||||
}
|
}
|
||||||
if ((peep->peep_flags & PEEP_FLAGS_LEAVING_PARK) && (peep->peep_is_lost_countdown < 90))
|
if ((peep->PeepFlags & PEEP_FLAGS_LEAVING_PARK) && (peep->GuestIsLostCountdown < 90))
|
||||||
{
|
{
|
||||||
lostGuestCount++;
|
lostGuestCount++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ protected:
|
||||||
// that with no actual ride to head towards, when a peep reaches a junction they use the 'aimless'
|
// that with no actual ride to head towards, when a peep reaches a junction they use the 'aimless'
|
||||||
// pathfinder instead of pursuing their original pathfinding target. So, we always need to give them
|
// pathfinder instead of pursuing their original pathfinding target. So, we always need to give them
|
||||||
// an actual ride to walk to the entrance of.
|
// an actual ride to walk to the entrance of.
|
||||||
peep->guest_heading_to_ride_id = targetRideID;
|
peep->GuestHeadingToRideId = targetRideID;
|
||||||
|
|
||||||
// Pick the direction the peep should initially move in, given the goal position.
|
// Pick the direction the peep should initially move in, given the goal position.
|
||||||
// This will also store the goal position and initialize pathfinding data for the peep.
|
// This will also store the goal position and initialize pathfinding data for the peep.
|
||||||
|
|
|
@ -227,25 +227,25 @@ static void CompareSpriteDataPeep(const Peep& left, const Peep& right)
|
||||||
COMPARE_FIELD(thoughts[i].freshness);
|
COMPARE_FIELD(thoughts[i].freshness);
|
||||||
COMPARE_FIELD(thoughts[i].fresh_timeout);
|
COMPARE_FIELD(thoughts[i].fresh_timeout);
|
||||||
}
|
}
|
||||||
COMPARE_FIELD(path_check_optimisation);
|
COMPARE_FIELD(PathCheckOptimisation);
|
||||||
COMPARE_FIELD(guest_heading_to_ride_id);
|
COMPARE_FIELD(GuestHeadingToRideId);
|
||||||
COMPARE_FIELD(staff_orders);
|
COMPARE_FIELD(StaffOrders);
|
||||||
COMPARE_FIELD(photo1_ride_ref);
|
COMPARE_FIELD(Photo1RideRef);
|
||||||
COMPARE_FIELD(peep_flags);
|
COMPARE_FIELD(PeepFlags);
|
||||||
COMPARE_FIELD(pathfind_goal.x);
|
COMPARE_FIELD(PathfindGoal.x);
|
||||||
COMPARE_FIELD(pathfind_goal.y);
|
COMPARE_FIELD(PathfindGoal.y);
|
||||||
COMPARE_FIELD(pathfind_goal.z);
|
COMPARE_FIELD(PathfindGoal.z);
|
||||||
COMPARE_FIELD(pathfind_goal.direction);
|
COMPARE_FIELD(PathfindGoal.direction);
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
COMPARE_FIELD(pathfind_history[i].x);
|
COMPARE_FIELD(PathfindHistory[i].x);
|
||||||
COMPARE_FIELD(pathfind_history[i].y);
|
COMPARE_FIELD(PathfindHistory[i].y);
|
||||||
COMPARE_FIELD(pathfind_history[i].z);
|
COMPARE_FIELD(PathfindHistory[i].z);
|
||||||
COMPARE_FIELD(pathfind_history[i].direction);
|
COMPARE_FIELD(PathfindHistory[i].direction);
|
||||||
}
|
}
|
||||||
COMPARE_FIELD(no_action_frame_num);
|
COMPARE_FIELD(WalkingFrameNum);
|
||||||
COMPARE_FIELD(litter_count);
|
COMPARE_FIELD(LitterCount);
|
||||||
COMPARE_FIELD(time_on_ride);
|
COMPARE_FIELD(GuestTimeOnRide);
|
||||||
COMPARE_FIELD(DisgustingCount);
|
COMPARE_FIELD(DisgustingCount);
|
||||||
COMPARE_FIELD(PaidToEnter);
|
COMPARE_FIELD(PaidToEnter);
|
||||||
COMPARE_FIELD(PaidOnRides);
|
COMPARE_FIELD(PaidOnRides);
|
||||||
|
|
Loading…
Reference in New Issue