1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Merge pull request #13667 from ZehMatt/refactor/invalidation

Simplify object invalidation automatically when possible
This commit is contained in:
ζeh Matt
2021-01-03 20:10:15 +02:00
committed by GitHub
18 changed files with 71 additions and 103 deletions

View File

@@ -104,9 +104,7 @@ namespace OpenRCT2::Scripting
auto entity = GetEntity();
if (entity != nullptr)
{
entity->Invalidate2();
entity->MoveTo({ value, entity->y, entity->z });
entity->Invalidate2();
}
}
@@ -122,9 +120,7 @@ namespace OpenRCT2::Scripting
auto entity = GetEntity();
if (entity != nullptr)
{
entity->Invalidate2();
entity->MoveTo({ entity->x, value, entity->z });
entity->Invalidate2();
}
}
@@ -140,9 +136,7 @@ namespace OpenRCT2::Scripting
auto entity = GetEntity();
if (entity != nullptr)
{
entity->Invalidate2();
entity->MoveTo({ entity->x, entity->y, value });
entity->Invalidate2();
}
}
@@ -152,7 +146,7 @@ namespace OpenRCT2::Scripting
auto entity = GetEntity();
if (entity != nullptr)
{
entity->Invalidate2();
entity->Invalidate();
switch (entity->sprite_identifier)
{
case SpriteIdentifier::Vehicle: