1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 08:45:00 +01:00

Fix missing invalidation on various plugin api setters for entities (#24310)

This commit is contained in:
Basssiiie
2025-04-30 22:59:17 +02:00
committed by GitHub
parent c55049288b
commit cae36aa010
7 changed files with 19 additions and 0 deletions

View File

@@ -22,6 +22,7 @@
- Fix: [#24121] Checkbox labels run beyond the edge of the window if theyre too long to fit.
- Fix: [#24142] [Plugin] Track origin is miscalculated on downward slopes.
- Fix: [#24220] Narrow station platforms have missing sides on certain rotations.
- Fix: [#24310] [Plugin] Missing invalidation on various plugin api setters for entities.
0.4.21 (2025-04-05)
------------------------------------------------------------------------

View File

@@ -47,6 +47,7 @@ namespace OpenRCT2::Scripting
if (balloon != nullptr)
{
balloon->colour = value;
balloon->Invalidate();
}
}

View File

@@ -70,6 +70,7 @@ namespace OpenRCT2::Scripting
return;
auto* litter = GetLitter();
litter->SubType = it->second;
litter->Invalidate();
}
uint32_t ScLitter::creationTick_get() const

View File

@@ -58,6 +58,7 @@ namespace OpenRCT2::Scripting
{
entity->frame = std::clamp<uint16_t>(value, 0, kCrashedVehicleParticleNumberSprites - 1)
* kCrashedVehicleParticleFrameToSprite;
entity->Invalidate();
}
}
uint8_t ScCrashedVehicleParticle::frame_get() const
@@ -76,6 +77,7 @@ namespace OpenRCT2::Scripting
if (entity != nullptr)
{
entity->crashed_sprite_base = CrashParticleTypeMap[value];
entity->Invalidate();
}
}
std::string ScCrashedVehicleParticle::crashedSpriteBase_get() const
@@ -194,6 +196,7 @@ namespace OpenRCT2::Scripting
{
entity->crashed_sprite_base = CrashParticleTypeMap[value["crashParticleType"].as_string()];
}
entity->Invalidate();
}
}
@@ -218,6 +221,7 @@ namespace OpenRCT2::Scripting
auto colours = FromDuk<VehicleColour>(value);
entity->colour[0] = colours.Body;
entity->colour[1] = colours.Trim;
entity->Invalidate();
}
}
}; // namespace OpenRCT2::Scripting

View File

@@ -155,6 +155,7 @@ namespace OpenRCT2::Scripting
{
peep->PeepDirection = value;
peep->Orientation = value << 3;
peep->Invalidate();
}
}
@@ -171,6 +172,7 @@ namespace OpenRCT2::Scripting
{
value = std::clamp(value, kPeepMinEnergy, kPeepMaxEnergy);
peep->Energy = value;
peep->Invalidate();
}
}

View File

@@ -102,6 +102,7 @@ namespace OpenRCT2::Scripting
// Reset state to walking to prevent invalid actions from carrying over
peep->Action = PeepActionType::Walking;
peep->AnimationType = peep->NextAnimationType = PeepAnimationType::Walking;
peep->Invalidate();
}
}
@@ -119,6 +120,7 @@ namespace OpenRCT2::Scripting
{
peep->TshirtColour = value;
peep->TrousersColour = value;
peep->Invalidate();
}
}
@@ -210,6 +212,7 @@ namespace OpenRCT2::Scripting
peep->AnimationObjectIndex = costume->objectId;
peep->AnimationGroup = costume->group;
peep->Invalidate();
}
std::shared_ptr<ScPatrolArea> ScStaff::patrolArea_get() const

View File

@@ -111,6 +111,7 @@ namespace OpenRCT2::Scripting
if (vehicle != nullptr)
{
vehicle->ride_subtype = value;
vehicle->Invalidate();
}
}
@@ -126,6 +127,7 @@ namespace OpenRCT2::Scripting
if (vehicle != nullptr)
{
vehicle->vehicle_type = value;
vehicle->Invalidate();
}
}
@@ -141,6 +143,7 @@ namespace OpenRCT2::Scripting
if (vehicle != nullptr)
{
vehicle->Pitch = value;
vehicle->Invalidate();
}
}
@@ -337,6 +340,7 @@ namespace OpenRCT2::Scripting
if (vehicle != nullptr)
{
vehicle->bank_rotation = value;
vehicle->Invalidate();
}
}
@@ -362,6 +366,7 @@ namespace OpenRCT2::Scripting
{
vehicle->ClearFlag(flag);
}
vehicle->Invalidate();
}
}
@@ -382,6 +387,7 @@ namespace OpenRCT2::Scripting
if (vehicle != nullptr)
{
vehicle->colours = FromDuk<VehicleColour>(value);
vehicle->Invalidate();
}
}
@@ -485,6 +491,7 @@ namespace OpenRCT2::Scripting
if (vehicle != nullptr)
{
vehicle->spin_sprite = value;
vehicle->Invalidate();
}
}