Mercurial > hg > openttd
changeset 17899:c5c5f8f160df draft
(svn r22698) -Fix [FS#4694]: 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.
author | frosch <frosch@openttd.org> |
---|---|
date | Sat, 30 Jul 2011 12:28:49 +0000 |
parents | 307d1c360da9 |
children | 684991201b65 |
files | src/object_cmd.cpp |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -425,10 +425,6 @@ 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 @@ 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;