prohibit creation of more plants than seed amount in seed area

stable-6.1
Maikel de Vries 2015-04-02 19:46:33 +02:00
parent c5de5ab487
commit 89ccec58ae
1 changed files with 2 additions and 2 deletions

View File

@ -110,8 +110,8 @@ public func Seed()
// the chance of seeding is improved, if there are much the chance is reduced.
var chance = SeedChance();
var chance = chance / Max(1, amount - plant_cnt) + chance * Max(0, plant_cnt - amount);
// Place a plant if we are lucky, in principle there can be more than seed amount.
if (!Random(chance))
// Place a plant if we are lucky, but no more than seed amount.
if (plant_cnt < amount && !Random(chance))
{
// Place the plant but check if it is not close to another one.
var plant = PlaceVegetation(GetID(), area.x, area.y, area.w, area.h, 3);