VarAction2: Re-use allocated callback result sprite groups

This commit is contained in:
Jonathan G Rennison
2022-06-04 20:29:32 +01:00
parent 9c86f90bdd
commit bbc1e28b24
3 changed files with 31 additions and 11 deletions

View File

@@ -259,7 +259,7 @@ const SpriteGroup *DeterministicSpriteGroup::Resolve(ResolverObject &object) con
if (this->calculated_result) {
/* nvar == 0 is a special case -- we turn our value into a callback result */
if (value != CALLBACK_FAILED) value = GB(value, 0, 15);
static CallbackResultSpriteGroup nvarzero(0, true);
static CallbackResultSpriteGroup nvarzero(0);
nvarzero.result = value;
return &nvarzero;
}