don't place branch and trunk in liquids

stable-6.1
Maikel de Vries 2015-03-15 18:08:14 +01:00
parent 61ffb0fb28
commit e7d66139eb
3 changed files with 3 additions and 8 deletions

View File

@ -49,7 +49,7 @@ public func Place(int amount, proplist rectangle, proplist settings)
for (var i = 0; i < amount; i++)
{
var size = RandomX(settings.size[0], settings.size[1]);
var loc = FindLocation(loc_background, Loc_Wall(CNAT_Left | CNAT_Right | CNAT_Top), loc_area);
var loc = FindLocation(loc_background, Loc_Not(Loc_Liquid()), Loc_Wall(CNAT_Left | CNAT_Right | CNAT_Top), loc_area);
if (!loc)
continue;
var branch = CreateObjectAbove(Branch);

View File

@ -109,7 +109,7 @@ public func Place(int amount, proplist rectangle, proplist settings)
for (var i = 0; i < amount; i++)
{
var size = RandomX(settings.size[0], settings.size[1]);
var loc = FindLocation(loc_background, Loc_Wall(CNAT_Left | CNAT_Right | CNAT_Top), loc_area);
var loc = FindLocation(loc_background, Loc_Not(Loc_Liquid()), Loc_Wall(CNAT_Left | CNAT_Right | CNAT_Top), loc_area);
if (!loc)
continue;
var trunk = CreateObjectAbove(Trunk);

View File

@ -143,12 +143,7 @@ private func InitVegetation(int map_size, int difficulty)
// Some branches and trunks.
Branch->Place(24 + Random(12));
for (var i = 0; i < 4 + Random(3); i++)
{
PlaceVegetation(Trunk, top.x, top.y, top.w, top.h, 1000 * (61 + Random(40)));
PlaceVegetation(Trunk, middle.x, middle.y, middle.w, middle.h, 1000 * (61 + Random(40)));
PlaceVegetation(Trunk, bottom.x, bottom.y, bottom.w, bottom.h, 1000 * (61 + Random(40)));
}
Trunk->Place(12 + Random(8));
// Some objects in the earth.
PlaceObjects(Rock, 25 + 10 * map_size + Random(10),"Earth");