ENTITY* CurrSand;
int VecTotal = ent_status(Sand[2][2],0);//terrain total vectors
var VecDist;//store distance to terrain center
int tx; int ty; int i;
for (i=VecTotal; i>0; i--)
{
for(tx=0;tx<5;tx++)
{
for(ty=0;ty<5;ty++)
{
CurrSand=Sand[tx][ty];
CONTACT* c1 = ent_getvertex(CurrSand,NULL,i);
if(CurrSand.skill1==1)
{
VecDist=vec_dist(vector(((i-1)%33),(integer((i-1)/33)),0),vector(16,16,0));
if(VecDist<=10)
{
c1.v.y= (-1*((2*(VecDist))*(2*(VecDist))))+50;
}
else
{
c1.v.y= -360;
}
}
else
{
c1.v.y = -360;
}
ent_setvertex(CurrSand,c1,i);
}
}
}