extern void object::ShowBarrel( )
{
	int		stamp = -1;

	errmode(0);  // ne stoppe pas si erreur

	while ( true )
	{
		wait(1+rand());
		if ( stamp != decorstamp() )
		{
			stamp = decorstamp();

			if ( IfBarrel(-110,-50, 30, -110,-50) )
			{
				action(6);  // show direction
				continue;
			}

			if ( IfBarrel(0,0, 1000, -110,-110) )
			{
				action(6);  // show direction
				continue;
			}

			action(2);  // fear
		}
	}
}

bool object::IfBarrel(float cx, float cy, float min, float dx, float dy)
{
	object	item;
	point	pos;

	pos.x = cx;
	pos.y = cy;
	item = search(BarrelAtomic, pos);
	if ( item == null )  return false;
	if ( distance2d(item.position, pos) > min )  return false;

	pos.x = dx;
	pos.y = dy;
	turn(direction(pos)+90);
	return true;
}
