1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-23 04:04:09 +01:00

Codechange: explicitly initialise Object member variables

This commit is contained in:
Rubidium
2025-02-18 17:52:56 +01:00
committed by rubidium42
parent 6eb2dec338
commit 8682f39966
2 changed files with 9 additions and 12 deletions

View File

@@ -90,12 +90,7 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u
const ObjectSpec *spec = ObjectSpec::Get(type);
TileArea ta(tile, GB(spec->size, HasBit(view, 0) ? 4 : 0, 4), GB(spec->size, HasBit(view, 0) ? 0 : 4, 4));
Object *o = new Object();
o->type = type;
o->location = ta;
o->town = town == nullptr ? CalcClosestTownFromTile(tile) : town;
o->build_date = TimerGameCalendar::date;
o->view = view;
Object *o = new Object(type, town == nullptr ? CalcClosestTownFromTile(tile) : town, ta, TimerGameCalendar::date, view);
/* If nothing owns the object, the colour will be random. Otherwise
* get the colour from the company's livery settings. */