(svn r20743) -Fix: Make testruns of clearing an object tile not influence repeated testruns resp. the exec run.
This commit is contained in:
@@ -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!
|
||||
|
Reference in New Issue
Block a user