1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 09:52:44 +01:00

Codechange: Pass avail(able) as reference instead of pointer since they are never nullptr (#12696)

This commit is contained in:
Loïc Guilloux
2024-05-18 17:04:16 +02:00
committed by GitHub
parent ba47d1ca2b
commit 29ce013eda
33 changed files with 75 additions and 75 deletions

View File

@@ -169,7 +169,7 @@ public:
* @param avail Return whether the variable is available.
* @return The resolved variable's value.
*/
virtual uint Resolve(uint index, uint var, uint param, bool *avail) const = 0;
virtual uint Resolve(uint index, uint var, uint param, bool &avail) const = 0;
/**
* Used to decide if the PSA needs a parameter or not.
@@ -449,7 +449,7 @@ struct NewGRFInspectWindow : Window {
for (const NIVariable *niv = nif->variables; niv->name != nullptr; niv++) {
bool avail = true;
uint param = HasVariableParameter(niv->var) ? NewGRFInspectWindow::var60params[GetFeatureNum(this->window_number)][niv->var - 0x60] : 0;
uint value = nih->Resolve(index, niv->var, param, &avail);
uint value = nih->Resolve(index, niv->var, param, avail);
if (!avail) continue;