1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-24 20:54:08 +01:00

Fix: [NewGRF] The result of Action123 evaluation affected rerandomisation in a weird corner case. (#14139)

Rerandomisation does not care about the Resolve result.
But we skipped it, in case of 'invalid SpriteGroup reference'.
This commit is contained in:
frosch
2025-04-28 23:24:42 +02:00
committed by GitHub
parent b281c5616e
commit 30b1eb6e5f
6 changed files with 20 additions and 11 deletions

View File

@@ -1255,8 +1255,7 @@ static void DoTriggerVehicleRandomisation(Vehicle *v, VehicleRandomTrigger trigg
v->waiting_random_triggers.Set(trigger); // store now for var 5F
object.SetWaitingRandomTriggers(v->waiting_random_triggers);
const SpriteGroup *group = object.Resolve();
if (group == nullptr) return;
object.ResolveRerandomisation();
/* Store remaining triggers. */
v->waiting_random_triggers.Reset(object.GetUsedRandomTriggers());