function AISMN_VisitSaloon::OnEnter(%this,%obj)
{
   if(SetPathForNearestTeamBuilding(%obj, "Saloon", $OST_PLAYER)) 
   {     
      if(%obj.isDrunk())
         GetThisObject(%obj).playThread( 0, "drunkwalk");
      else
         GetThisObject(%obj).playThread( 0, "run");
   }
	
	return;
}

function AISMN_VisitSaloon::OnExit(%this,%obj)
{
   if(%obj.isDrunk())
      GetThisObject(%obj).playThread( 0, "drunkroot");
   else
      GetThisObject(%obj).playThread( 0, "root");
	return;
}

//EXIT 0: ARRIVED AT LOCATION (FOR NON-DRUNKS)
//EXIT 1: ARRIVED AT LOCATION (FOR DRUNKS)
function AISMN_VisitSaloon::Update(%this,%obj)
{
   if(!IsFollowingPath(%obj))
   {
      if(!%obj.isDrunk())
         ReturnValue(%obj,0);
      else
         ReturnValue(%obj,1);
      return;
   }
   ReturnValue(%obj,-1);
   return;
}