1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 20:13:07 +01:00

Use const ref on MoneyEffect::Create

This commit is contained in:
Tulio Leao
2020-06-21 14:22:17 -03:00
parent f6dae982a6
commit ad529c7f6c
2 changed files with 6 additions and 5 deletions

View File

@@ -64,8 +64,9 @@ void MoneyEffect::CreateAt(money32 value, const CoordsXYZ& effectPos, bool verti
*
* rct2: 0x0069C5D0
*/
void MoneyEffect::Create(money32 value, CoordsXYZ loc)
void MoneyEffect::Create(money32 value, const CoordsXYZ& loc)
{
auto offsetLoc = loc;
if (loc.isNull())
{
// If game actions return no valid location of the action we can not use the screen
@@ -86,10 +87,10 @@ void MoneyEffect::Create(money32 value, CoordsXYZ loc)
if (!mapPositionXY)
return;
loc = { *mapPositionXY, tile_element_height(*mapPositionXY) };
offsetLoc = { *mapPositionXY, tile_element_height(*mapPositionXY) };
}
loc.z += 10;
CreateAt(-value, loc, false);
offsetLoc.z += 10;
CreateAt(-value, offsetLoc, false);
}
/**

View File

@@ -82,7 +82,7 @@ struct MoneyEffect : SpriteBase
uint16_t Wiggle;
static void CreateAt(money32 value, const CoordsXYZ& effectPos, bool vertical);
static void Create(money32 value, CoordsXYZ loc);
static void Create(money32 value, const CoordsXYZ& loc);
void Update();
std::pair<rct_string_id, money32> GetStringId() const;
};