function get_ambient()
{
var fmt, pxl; COLOR tmpC;
c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|SCAN_TEXTURE);
if(trace_hit)
{
my.ambient = -55;
fmt = bmap_lock(hit.skin2,0);
pxl = pixel_for_bmap(hit.skin2,hit.u1,hit.v1);
bmap_unlock(hit.skin2);
pixel_to_vec(tmpC, NULL, fmt, pxl);
my.ambient = my.ambient + ((tmpC.red + tmpC.green + tmpC.blue) / 3);
}
}
//