Cleanup: Use std::vector in RandomSpriteGroup.
(cherry picked from commit 913d8a7f28
)
This commit is contained in:

committed by
Jonathan G Rennison

parent
a69a1d19a9
commit
f5722a999e
@@ -56,11 +56,6 @@ TemporaryStorageArray<int32, 0x110> _temp_store;
|
||||
}
|
||||
}
|
||||
|
||||
RandomizedSpriteGroup::~RandomizedSpriteGroup()
|
||||
{
|
||||
free(this->groups);
|
||||
}
|
||||
|
||||
static inline uint32 GetVariable(const ResolverObject &object, ScopeResolver *scope, byte variable, uint32 parameter, GetVariableExtra *extra)
|
||||
{
|
||||
uint32 value;
|
||||
@@ -275,11 +270,11 @@ const SpriteGroup *RandomizedSpriteGroup::Resolve(ResolverObject &object) const
|
||||
|
||||
if (res) {
|
||||
object.used_triggers |= match;
|
||||
object.reseed[this->var_scope] |= (this->num_groups - 1) << this->lowest_randbit;
|
||||
object.reseed[this->var_scope] |= (this->groups.size() - 1) << this->lowest_randbit;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 mask = (this->num_groups - 1) << this->lowest_randbit;
|
||||
uint32 mask = ((uint)this->groups.size() - 1) << this->lowest_randbit;
|
||||
byte index = (scope->GetRandomBits() & mask) >> this->lowest_randbit;
|
||||
|
||||
return SpriteGroup::Resolve(this->groups[index], object, false);
|
||||
|
Reference in New Issue
Block a user