Codechange: Pass avail(able) as reference instead of pointer since they are never nullptr (#12696)
This commit is contained in:
@@ -53,7 +53,7 @@ TemporaryStorageArray<int32_t, 0x110> _temp_store;
|
||||
}
|
||||
}
|
||||
|
||||
static inline uint32_t GetVariable(const ResolverObject &object, ScopeResolver *scope, uint8_t variable, uint32_t parameter, bool *available)
|
||||
static inline uint32_t GetVariable(const ResolverObject &object, ScopeResolver *scope, uint8_t variable, uint32_t parameter, bool &available)
|
||||
{
|
||||
uint32_t value;
|
||||
switch (variable) {
|
||||
@@ -103,10 +103,10 @@ static inline uint32_t GetVariable(const ResolverObject &object, ScopeResolver *
|
||||
* @param[out] available Set to false, in case the variable does not exist.
|
||||
* @return Value
|
||||
*/
|
||||
/* virtual */ uint32_t ScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool *available) const
|
||||
/* virtual */ uint32_t ScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const
|
||||
{
|
||||
Debug(grf, 1, "Unhandled scope variable 0x{:X}", variable);
|
||||
*available = false;
|
||||
available = false;
|
||||
return UINT_MAX;
|
||||
}
|
||||
|
||||
@@ -205,9 +205,9 @@ const SpriteGroup *DeterministicSpriteGroup::Resolve(ResolverObject &object) con
|
||||
|
||||
/* Note: 'last_value' and 'reseed' are shared between the main chain and the procedure */
|
||||
} else if (adjust.variable == 0x7B) {
|
||||
value = GetVariable(object, scope, adjust.parameter, last_value, &available);
|
||||
value = GetVariable(object, scope, adjust.parameter, last_value, available);
|
||||
} else {
|
||||
value = GetVariable(object, scope, adjust.variable, adjust.parameter, &available);
|
||||
value = GetVariable(object, scope, adjust.variable, adjust.parameter, available);
|
||||
}
|
||||
|
||||
if (!available) {
|
||||
|
||||
Reference in New Issue
Block a user