      SUBROUTINE KLQ(JJ,IR)                                             2339

c	include 'tcommon.for'
	%include tcommon.for

      IN=0                                                              2364
      JN=0                                                              2365
C     ...CHECK WHICH WAY K LEFT QUAD.                                   2366
      IF(XKL(JJ,1).LT..5)IN=-1                                          2367
      IF(XKL(JJ,2).LT..5)JN=-1                                          2368
      IF(XKL(JJ,1).GE.10.5)IN=1                                         2369
      IF(XKL(JJ,2).GE.10.5)JN=1                                         2370
      IR=0                                                              2371
      IF(IN.EQ.0.AND.JN.EQ.0)RETURN                                     2372
      IR=1                                                              2373
      IN=IN+ICE                                                         2374
      JN=JN+JCE                                                         2375
      IKG=(JGAL(IN,JN))                                                 2376
      IF(IKG-IKG/1000*1000.GE.900)GO TO 2471                            2377
C     ...CHECK IF LEAVING GALAXY.                                       2378
      IF(IN.LT.1.OR.JN.LT.1.OR.IN.GT.NQUAD.OR.JN.GT.NQUAD)GO TO 2468    2379
      WRITE(6,2467)LETR(3),JJ,IN,JN                                     2380
2467  FORMAT(1X,A1,I1,' ESCAPED TO QUADRANT ',I2,',',I2)                2381
      JGAL(ICE,JCE)=JGAL(ICE,JCE)-100                                   2382
      IF(IDMG(6).NE.0.OR.IDMG(7).NE.0)     IGAL(ICE,JCE)=JGAL(ICE,JCE)  2383
      IF(ITRMEN(JJ+1).EQ.0)GO TO 100                                    2384
      WRITE(6,101)ITRMEN(JJ+1)                                          2385
101   FORMAT(I4,' TROOPS CAPTURED BY ENEMY')                            2386
      ITRMEN(JJ+1)=0                                                    2387
      IF(ISTAT.EQ.0)GO TO 100                                           2388
C     ...STOP BEAMING.                                                  2389
      IF(JUP.EQ.3.AND.JFROM.EQ.JJ.OR.JDOWN.EQ.3.AND.JTO.EQ.JJ)ISTAT=99992390
100   ICNTL(JJ+1)=0                                                     2391
      JGAL(IN,JN)=JGAL(IN,JN)+100                                       2392
      XKL(JJ,1)=0.                                                      2393
      RETURN                                                            2394
2468  WRITE(6,2469)LETR(3),JJ                                           2395
2469  FORMAT(1X,A1,I1,' EXCEEDED GALACTIC LIMITS')                      2396
      IN=3                                                              2397
      CALL DLETE(IN,JJ)                                                 2398
      IR=2                                                              2399
      RETURN                                                            2400
2471  IF(XKL(JJ,1).LT..5)XKL(JJ,1)=.6                                   2401
      IF(XKL(JJ,2).LT..5)XKL(JJ,2)=.6                                   2402
      IF(XKL(JJ,1).GT.10.5)XKL(JJ,1)=10.4                               2403
      IF(XKL(JJ,2).GT.10.5)XKL(JJ,2)=10.4                               2404
      RETURN                                                            2405
      END                                                               2406
