Index: data/branches/single_player_map/scripts/prisoner.lua
===================================================================
--- data/branches/single_player_map/scripts/prisoner.lua	(revision 3964)
+++ data/branches/single_player_map/scripts/prisoner.lua	(revision 3965)
@@ -19,9 +19,9 @@
 
 function observeGuard()
-guardX = guard:getAbsCoorX()
-guardY = guard:getAbsCoorY()
-guardZ = guard:getAbsCoorZ()
-
-if dist( guardX,guardY,guardZ, 198.427155, 29, 243.656113 ) < 60 then
+guardX = secondguard:getAbsCoorX()
+guardY = secondguard:getAbsCoorY()
+guardZ = secondguard:getAbsCoorZ()
+
+if dist( guardX,guardY,guardZ, 43.406876, 29, 179.517303) < 60 then
 cellDoorOpened = true
 end
@@ -40,7 +40,10 @@
 end
 
+
+
 walkProgrammed = false
 exitProgrammed = false
 function walkInCell(timestep)
+
 
 if not walkProgrammed then
@@ -71,6 +74,7 @@
 
 if prisoner:finalGoalReached() and not cellDoorOpened then
-   walkProgrammed = false
-  end
+ walkProgrammed = false
+end
+
 
 if cellDoorOpened then
@@ -109,22 +113,155 @@
   end
 
- end 
-
-return false
-
-end
-
-
-return false
-
-end
-
-
-gotoExitProgrammed = false
-function goToExit(timestep)
--- do not forget to make him wait until the player triggeres the trip to the hangar
-if not gotoExitProgrammed and playerInLock then
-
-gotoExitProgrammed = true
+end 
+
+return false
+
+end
+
+
+hangarRouteProgrammed = false
+function goToHangar(timestep)
+
+if not hangarRouteProgrammed and playerInLock then
+prisoner:walkTo( 149.255554, height, 253.358582)
+prisoner:walkTo( 155.679886, height, 274.126282)
+prisoner:walkTo( 157.556641, height, 285.543640)
+prisoner:walkTo( 159.016068, height, 294.552338)
+prisoner:walkTo( 160.234924, height, 303.494812)
+prisoner:walkTo( 161.399475, height, 313.532013)
+prisoner:walkTo( 162.218994, height, 323.290924)
+prisoner:walkTo( 162.030823, height, 335.226715)
+prisoner:walkTo( 161.351410, height, 378.328094)
+prisoner:walkTo( 161.183487, height, 388.983093)
+prisoner:walkTo( 160.590225, height, 426.615540)
+prisoner:walkTo( 160.313049, height, 444.198425)
+prisoner:walkTo( 160.410721, height, 454.192413)
+prisoner:walkTo( 161.796692, height, 465.085663)
+prisoner:walkTo( 163.096069, height, 474.038086)
+prisoner:walkTo( 165.596329, height, 485.415924)
+prisoner:walkTo( 167.407303, height, 493.229279)
+prisoner:walkTo( 169.595749, height, 499.048309)
+prisoner:walkTo( 173.485214, height, 504.383026)
+prisoner:walkTo( 182.131546, height, 510.774567)
+prisoner:walkTo( 187.788422, height, 512.870789)
+prisoner:walkTo( 196.524994, height, 514.751892)
+prisoner:walkTo( 205.403473, height, 515.840271)
+prisoner:walkTo( 205.403473, height, 515.840271)
+prisoner:walkTo( 220.813049, height, 515.886658)
+prisoner:walkTo( 392.501221, height, 516.405579)
+prisoner:walkTo( 441.405975, height, 516.502502)
+prisoner:walkTo( 513.379517, height, 515.572266)
+prisoner:walkTo( 586.638611, height, 514.625244)
+prisoner:walkTo( 651.319214, height, 513.789246)
+prisoner:walkTo( 680.890869, height, 513.406982)
+prisoner:walkTo( 701.035828, height, 512.568359)
+prisoner:walkTo( 716.025879, height, 510.741150)
+prisoner:walkTo( 723.756042, height, 509.009583)
+prisoner:walkTo( 733.522095, height, 504.761475)
+prisoner:walkTo( 738.782104, height, 501.529327)
+prisoner:walkTo( 744.840637, height, 496.154846)
+prisoner:walkTo( 750.059875, height, 487.892670)
+prisoner:walkTo( 753.419373, height, 477.053894)
+prisoner:walkTo( 754.661743, height, 470.759735)
+prisoner:walkTo( 765.877319, height, 397.575897)
+prisoner:walkTo( 768.522522, height, 360.462250)
+prisoner:walkTo( 769.531250, height, 326.195801)
+prisoner:walkTo( 770.420532, height, 286.531830)
+prisoner:walkTo( 769.840393, height, 238.220535)
+prisoner:walkTo( 771.094543, height, 172.138474)
+prisoner:walkTo( 772.765137, height, 94.427673)
+prisoner:walkTo( 771.779175, height, 62.094421)
+prisoner:walkTo( 771.069336, height, 35.182930)
+prisoner:walkTo( 769.679199, height, 4.657598)
+prisoner:walkTo( 768.049377, height, -23.208313)
+prisoner:walkTo( 766.691711, height, -54.609066)
+prisoner:walkTo( 765.022156, height, -85.732277)
+prisoner:walkTo( 763.538635, height, -110.417847)
+prisoner:walkTo( 761.547485, height, -143.547577)
+prisoner:walkTo( 760.982483, height, -147.543091)
+prisoner:walkTo( 756.619934, height, -163.474457)
+prisoner:walkTo( 751.651611, height, -180.926727)
+prisoner:walkTo( 739.842041, height, -216.826782)
+prisoner:walkTo( 716.715149, height, -294.878693)
+prisoner:walkTo( 698.400146, height, -365.404541)
+prisoner:walkTo( 692.199890, height, -396.395386)
+prisoner:walkTo( 685.157593, height, -437.489929)
+prisoner:walkTo( 678.175537, height, -475.680817)
+prisoner:walkTo( 674.907837, height, -505.428314)
+prisoner:walkTo( 674.588501, height, -531.477478)
+prisoner:walkTo( 674.703308, height, -550.883789)
+prisoner:walkTo( 675.315063, height, -567.361206)
+prisoner:walkTo( 676.178345, height, -583.178772)
+prisoner:walkTo( 678.579407, height, -638.655518)
+prisoner:walkTo( 689.508118, height, -884.296448)
+prisoner:walkTo( 690.749084, height, -917.750366)
+prisoner:walkTo( 691.617676, height, -933.357056)
+prisoner:walkTo( 696.260742, height, -972.685669)
+prisoner:walkTo( 698.526550, height, -990.077209)
+prisoner:walkTo( 705.576599, height, -1033.587646)
+prisoner:walkTo( 719.388611, height, -1111.123657)
+prisoner:walkTo( 724.847229, height, -1137.902832)
+prisoner:walkTo( 729.118652, height, -1159.426514)
+prisoner:walkTo( 733.152161, height, -1179.577393)
+prisoner:walkTo( 737.474365, height, -1200.200684)
+prisoner:walkTo( 740.808777, height, -1216.996216)
+prisoner:walkTo( 748.261108, height, -1252.447021)
+prisoner:walkTo( 748.648682, height, -1254.182983)
+prisoner:walkTo( 752.690430, height, -1272.386719)
+prisoner:walkTo( 755.726562, height, -1286.795532)
+prisoner:walkTo( 758.134705, height, -1302.620117)
+prisoner:walkTo( 759.900879, height, -1317.258911)
+prisoner:walkTo( 760.405212, height, -1357.575195)
+prisoner:walkTo( 760.203979, height, -1396.744385)
+prisoner:walkTo( 759.262085, height, -1433.674316)
+prisoner:walkTo( 758.916016, height, -1447.247437)
+prisoner:walkTo( 757.844910, height, -1474.596558)
+prisoner:walkTo( 756.331238, height, -1484.150269)
+prisoner:walkTo( 754.152283, height, -1491.574585)
+prisoner:walkTo( 750.549561, height, -1497.667236)
+prisoner:walkTo( 741.115356, height, -1509.581177)
+prisoner:walkTo( 733.292236, height, -1516.592407)
+prisoner:walkTo( 724.755798, height, -1522.380615)
+prisoner:walkTo( 712.188721, height, -1528.557495)
+prisoner:walkTo( 707.279907, height, -1530.261841)
+prisoner:walkTo( 698.749390, height, -1532.002563)
+prisoner:walkTo( 681.891785, height, -1532.067871)
+prisoner:walkTo( 625.072388, height, -1531.572266)
+prisoner:walkTo( 501.572601, height, -1533.919922)
+prisoner:walkTo( 237.189667, height, -1538.984985)
+prisoner:walkTo( 146.071304, height, -1540.965820)
+prisoner:walkTo( 88.186996, height, -1549.110962)
+prisoner:walkTo( 85.715096, height, -1549.537842)
+prisoner:walkTo( 66.997787, height, -1552.770264)
+prisoner:walkTo( 52.632504, height, -1555.359009)
+prisoner:walkTo( 38.350941, height, -1560.845459)
+prisoner:walkTo( 26.315248, height, -1568.211060)
+prisoner:walkTo( 15.210221, height, -1580.474121)
+prisoner:walkTo( 6.527347, height, -1594.483398)
+prisoner:walkTo( 3.175952, height, -1610.220093)
+
+hangarRouteProgrammed = true
+end
+
+thisX = prisoner:getAbsCoorX()
+thisY = prisoner:getAbsCoorY()
+thisZ = prisoner:getAbsCoorZ()
+
+if dist( thisX,thisY,thisZ, 3.175952, 29, -1610.220093) < 60 then
+return true
+end
+
+
+return false
+
+end
+
+spaceshipRouteProgrammed = false
+function goToSpaceship(timestep)
+
+if not spaceshipRouteProgrammed then
+
+
+spaceshipRouteProgrammed = true
 end
 
@@ -134,36 +271,4 @@
 
 return false
-end
-
-hangarRouteProgrammed = false
-function goToHangar(timestep)
-
-if not hangarRouteProgrammed then
-
-hangarRouteProgrammed = true
-end
-
-if prisoner:finalGoalReached() then
-   return true
-end
-
-return false
-
-end
-
-spaceshipRouteProgrammed = false
-function goToSpaceship(timestep)
-
-if not spaceshipRouteProgrammed then
-
-
-spaceshipRouteProgrammed = true
-end
-
-if prisoner:finalGoalReached() then
-   return true
-end
-
-return false
 
 end
@@ -183,13 +288,10 @@
 
 
-if not cellDoorOpend then
+if not walkinCellFinished then
 walkinCellFinished = walkInCell(timestep)
 end
 
-if walkinCellFinished and not exitReached then
-exitReached = goToExit(timestep)
-end
-
-if exitReached and not hangarReached then
+
+if walkinCellFinished and not hangarReached then
 hangarReached = goToHangar(timestep)
 end
