if(mouse_left==1)
{
a=1;//start at the first vertex of the house
nevar_celt=0;//Can i build a house here
while(a<=5)//check if can build
{
b=a+1;//secodn traced vertex
if(a>=5){b=1;}//Trace the first node, so that a square is traced
vec_for_vertex(node_pos,building_name,a);
vec_for_vertex(node_pos2,building_name,b);
if(c_trace(node_pos,node_pos2,IGNORE_ME|IGNORE_PASSABLE)>=1||c_trace(node_pos2,node_pos,IGNORE_ME|IGNORE_PASSABLE)>=1)
{
nevar_celt=1;//can't build the house here
set(building_name,LIGHT);
building_name.green=0;
building_name.blue=0;
building_name.red=255;
wait(-.1);
reset(building_name,LIGHT);
}
a+=1;//Continue to the next vertex
wait(1);
}
}