   LOGICAL FUNCTION ATHAND(OBJECT)
      USE ALLCOM

!     TRUE IF OBJECT READILY REACHABLE. CAN BE LYING HERE, IN HAND OR IN OPEN CONTAINER.

      INTEGER OBJECT,CONTNR
      LOGICAL TOTING,AJAR,ENCLSD,HOLDNG

      ATHAND = .FALSE.
      IF (PLACE(OBJECT).EQ.LOC.OR.HOLDNG(OBJECT)) THEN
         ATHAND = .TRUE.
      ELSEIF (ENCLSD(OBJECT)) THEN
         CONTNR=-PLACE(OBJECT)
         ATHAND=(AJAR(CONTNR).AND.(PLACE(CONTNR).EQ.LOC.OR.(TOTING(OBJECT).AND.HOLDNG(CONTNR))))
      ENDIF
      END
