C***  TOTING .TRUE. IF OBJ SOMEWHERE ON PERSON


       LOGICAL FUNCTION TOTING(OBJ)

C  TOTING(OBJ)  = TRUE IF THE OBJ IS BEING CARRIED (IN HAND OR
C                 CONTAINER).  OBJ MAY NOT BE REACHABLE.  SEE
C                 ALSO: ENCLSD, ATHAND, HOLDNG.

       IMPLICIT INTEGER(A-Z)
       COMMON /PLACOM/ ATLOC(250),LINK(300),PLACE(150),
     1          FIXED(150),MAXOBJ
       LOGICAL HOLDNG,ENCLSD,AAA,BBB,CCC

       CONTNR=-PLACE(OBJ)
       OUTER=-PLACE(CONTNR)
       OUTER2=-PLACE(OUTER)

       AAA=HOLDNG(CONTNR)
       BBB=ENCLSD(CONTNR).AND.HOLDNG(OUTER)
       CCC=ENCLSD(OUTER).AND.HOLDNG(OUTER2)

       TOTING=HOLDNG(OBJ).OR.(ENCLSD(OBJ).AND.(AAA.OR.BBB.OR.CCC))
       RETURN
       END
