mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 08:52:40 +01:00
(svn r22702) [1.1] -Backport from trunk:
- Fix: Cost of adding an extra road type to a bridge or tunnel was undercalculated [FS#4680, FS#4681] (r22700, r22699) - Fix: Only insert cleared object tiles into _cleared_object_areas if clearing actually succeeds, else subsequential tests of the same tile will be skipped and considered successful [FS#4694] (r22698) - Fix: When building a house it could be built at the wrong place if multitile houses failed some tests (r22697)
This commit is contained in:
@@ -425,10 +425,6 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
|
||||
Object *o = Object::GetByTile(tile);
|
||||
TileArea ta = o->location;
|
||||
|
||||
ClearedObjectArea *cleared_area = _cleared_object_areas.Append();
|
||||
cleared_area->first_tile = tile;
|
||||
cleared_area->area = ta;
|
||||
|
||||
CommandCost cost(EXPENSES_CONSTRUCTION, spec->GetClearCost() * ta.w * ta.h / 5);
|
||||
if (spec->flags & OBJECT_FLAG_CLEAR_INCOME) cost.MultiplyCost(-1); // They get an income!
|
||||
|
||||
@@ -486,6 +482,10 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
|
||||
break;
|
||||
}
|
||||
|
||||
ClearedObjectArea *cleared_area = _cleared_object_areas.Append();
|
||||
cleared_area->first_tile = tile;
|
||||
cleared_area->area = ta;
|
||||
|
||||
if (flags & DC_EXEC) ReallyClearObjectTile(o);
|
||||
|
||||
return cost;
|
||||
|
||||
Reference in New Issue
Block a user