Allow PlaceGrass function to limit vertical area of grass placement

stable-5.3
Charles Spurrill 2012-11-04 22:48:46 -08:00
parent b92b83a01f
commit 974073b728
1 changed files with 7 additions and 3 deletions

View File

@ -27,18 +27,22 @@ private func Destroy()
RemoveObject();
}
global func PlaceGrass(int amount, int start, int end)
global func PlaceGrass(int amount, int start, int end, int height, int bottom)
{
if (!start)
start = 0;
if (!end)
end = LandscapeWidth();
if(!height)
height = 0;
if(!bottom)
bottom = LandscapeHeight();
var x = start, y;
while (x < end)
{
y = 0;
while (y < LandscapeHeight())
y = height;
while (y < bottom)
{
if (GetMaterial(AbsX(x), AbsY(y)) == Material("Sky"))
if (GetMaterial(AbsX(x), AbsY(y + 3)) == Material("Earth"))