1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-25 07:29:10 +00:00

Codechange: CALLBACK_FAILED is an internal constant, do not use it as numeric value in VA2 computations.

This commit is contained in:
frosch
2025-04-28 13:23:19 +02:00
committed by frosch
parent 30b1eb6e5f
commit d90f6f01cc

View File

@@ -198,9 +198,10 @@ const SpriteGroup *DeterministicSpriteGroup::Resolve(ResolverObject &object) con
if (adjust.variable == 0x7E) {
const SpriteGroup *subgroup = SpriteGroup::Resolve(adjust.subroutine, object, false);
if (subgroup == nullptr) {
value = CALLBACK_FAILED;
value = UINT16_MAX;
} else {
value = subgroup->GetCallbackResult();
if (value == CALLBACK_FAILED) value = UINT16_MAX;
}
/* Note: 'last_value' and 'reseed' are shared between the main chain and the procedure */