Bugfix: Trees seed wrongly.

The trees actually seeded at a very wrong place in case the property "Confinement" was not set: The area.x, area.y, area.w, area.h coordinates were specified as global coordinates, but were used as offset coordinates in PlaceVegetation.

This leads to the trees seeding underground, too, unfortunately.
liquid_container
Mark 2016-04-11 22:12:51 +02:00
parent b6b5f5a79f
commit 9cb261aac8
1 changed files with 6 additions and 1 deletions

View File

@ -149,8 +149,13 @@ private func DoSeed()
area = confined_area->GetBoundingRectangle();
if (area.w <= 0 || area.h <= 0) return;
}
else
{
// Place the new plant in the original area
confined_area = area;
}
// Place the plant...
var plant = PlaceVegetation(GetID(), area.x, area.y, area.w, area.h, 3, confined_area);
var plant = PlaceVegetation(GetID(), 0, 0, 0, 0, 3, confined_area);
if (plant)
{
// ...but check if it is not close to another one.