Skip to content

Commit

Permalink
Use different name table offset depending on staff type (OpenRCT2#22813)
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronVanGeffen authored Sep 25, 2024
1 parent 04bdff0 commit 81b759e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/openrct2/entity/Peep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1608,7 +1608,14 @@ void Peep::FormatNameTo(Formatter& ft) const

if ((!isStaff && showGuestNames) || (isStaff && showStaffNames))
{
auto realNameStringId = GetRealNameStringIDFromPeepID(PeepId);
auto nameId = PeepId;
if (isStaff)
{
// Prevent staff from getting the same names by offsetting the name table based on staff type.
nameId *= 256 * EnumValue(staff->AssignedStaffType) + 1;
}

auto realNameStringId = GetRealNameStringIDFromPeepID(nameId);
ft.Add<StringId>(realNameStringId);
}
else if (isStaff)
Expand Down

0 comments on commit 81b759e

Please sign in to comment.