1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 17:54:50 +01:00

Add isEntertainer method to Staff class, small cleanup

This commit is contained in:
matheusvb3
2025-09-15 18:00:13 -03:00
committed by GitHub
parent 99065960f2
commit 2ad4d4be72
8 changed files with 17 additions and 13 deletions

View File

@@ -81,7 +81,7 @@ namespace OpenRCT2::Scripting
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Handyman);
peep->AnimationGroup = PeepAnimationGroup::Normal;
}
else if (value == "mechanic" && peep->AssignedStaffType != StaffType::Mechanic)
else if (value == "mechanic" && !peep->IsMechanic())
{
peep->AssignedStaffType = StaffType::Mechanic;
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Mechanic);
@@ -93,7 +93,7 @@ namespace OpenRCT2::Scripting
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Security);
peep->AnimationGroup = PeepAnimationGroup::Normal;
}
else if (value == "entertainer" && peep->AssignedStaffType != StaffType::Entertainer)
else if (value == "entertainer" && !peep->isEntertainer())
{
peep->AssignedStaffType = StaffType::Entertainer;
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Entertainer);
@@ -510,7 +510,7 @@ namespace OpenRCT2::Scripting
auto& scriptEngine = GetContext()->GetScriptEngine();
auto* ctx = scriptEngine.GetContext();
auto peep = GetMechanic();
if (peep != nullptr && peep->AssignedStaffType == StaffType::Mechanic)
if (peep != nullptr && peep->IsMechanic())
{
duk_push_uint(ctx, peep->StaffRidesFixed);
}
@@ -526,7 +526,7 @@ namespace OpenRCT2::Scripting
auto& scriptEngine = GetContext()->GetScriptEngine();
auto* ctx = scriptEngine.GetContext();
auto peep = GetMechanic();
if (peep != nullptr && peep->AssignedStaffType == StaffType::Mechanic)
if (peep != nullptr && peep->IsMechanic())
{
duk_push_uint(ctx, peep->StaffRidesInspected);
}