(svn r20743) -Fix: Make testruns of clearing an object tile not influence repeated testruns resp. the exec run.

This commit is contained in:
frosch
2010-09-05 13:31:39 +00:00
parent e723ce12ea
commit 4a4dd45193
4 changed files with 31 additions and 8 deletions

View File

@@ -347,7 +347,7 @@ static void ReallyClearObjectTile(Object *o)
delete o;
}
SmallVector<TileArea, 4> _cleared_object_areas;
SmallVector<ClearedObjectArea, 4> _cleared_object_areas;
static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
{
@@ -358,7 +358,9 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
Object *o = Object::GetByTile(tile);
TileArea ta = o->location;
*_cleared_object_areas.Append() = ta;
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!