Use PEEP_TYPE enum for rct_peep::type field

Use the PEEP_TYPE enum for rct_peep::type so that the compiler/debugger understand what values it should contain.
This commit is contained in:
Richard Fine 2019-01-01 22:11:02 +00:00
parent e1016bf71e
commit b716fd071d
3 changed files with 7 additions and 5 deletions

View File

@ -951,7 +951,7 @@ void peep_sprite_remove(rct_peep* peep)
window_invalidate_by_class(WC_STAFF_LIST);
gStaffModes[peep->staff_id] = 0;
peep->type = 0xFF;
peep->type = PEEP_TYPE_INVALID;
staff_update_greyed_patrol_areas();
peep->type = PEEP_TYPE_STAFF;

View File

@ -34,10 +34,12 @@
struct TileElement;
struct Ride;
enum PEEP_TYPE
enum PEEP_TYPE : uint8_t
{
PEEP_TYPE_GUEST,
PEEP_TYPE_STAFF
PEEP_TYPE_STAFF,
PEEP_TYPE_INVALID = 0xFF
};
enum PEEP_THOUGHT_TYPE
@ -553,7 +555,7 @@ struct rct_peep
PEEP_STATE state; // 0x2B
uint8_t sub_state; // 0x2C
uint8_t sprite_type; // 0x2D
uint8_t type; // 0x2E
PEEP_TYPE type; // 0x2E
union
{
uint8_t staff_type; // 0x2F

View File

@ -1449,7 +1449,7 @@ private:
dst->step_progress = src->step_progress;
dst->vandalism_seen = src->vandalism_seen;
dst->type = src->type;
dst->type = static_cast<PEEP_TYPE>(src->type);
dst->tshirt_colour = RCT1::GetColour(src->tshirt_colour);
dst->trousers_colour = RCT1::GetColour(src->trousers_colour);