]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Positions for all 9 occupants
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 3 May 2011 22:19:41 +0000 (01:19 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Tue, 3 May 2011 22:19:41 +0000 (01:19 +0300)
data/qcsrc/server/vore.qc

index 9a6f1b3c58e55c53dbf0445a8fb87d0bcfa1fb06..e0abddd907ca019de2f916b7dfac822484310445 100644 (file)
@@ -98,9 +98,6 @@ float Vore_CanLeave()
 // position the camera properly for prey\r
 void Vore_SetCamera()\r
 {\r
-       /*if not(self.stat_eaten)\r
-               return;*/\r
-\r
        local entity head;\r
        local vector oldforward, oldright, oldup;\r
        local float position_counter;\r
@@ -112,6 +109,10 @@ void Vore_SetCamera()
        makevectors(self.v_angle);\r
        v_forward_z = 0;\r
 \r
+       // In order to allow prey to see each other in the same stomach, we must position each occupant differently,\r
+       // else all players would overlap in the center. To do this, we run a loop on all players in the same stomach.\r
+       // For each player, the origin is updated, then a new origin is used for the next player and so on.\r
+       // This requires that no more than 9 players can be in a stomach at a time!\r
        FOR_EACH_PLAYER(head)\r
        {\r
                if(head.predator == self)\r
@@ -119,9 +120,31 @@ void Vore_SetCamera()
                        switch(position_counter)\r
                        {\r
                                case 0:\r
+                                       origin_apply = '0 0 0'; // first occupant sits in the middle\r
                                        break;\r
                                case 1:\r
-                                       origin_apply = '1 0 0';\r
+                                       origin_apply = '1 0 0'; // second occupant sits in the front\r
+                                       break;\r
+                               case 2:\r
+                                       origin_apply = '-1 0 0'; // third occupant sits in the back\r
+                                       break;\r
+                               case 3:\r
+                                       origin_apply = '0 1 0'; // fourth occupant sits in the right\r
+                                       break;\r
+                               case 4:\r
+                                       origin_apply = '0 -1 0'; // fifth occupant sits in the left\r
+                                       break;\r
+                               case 5:\r
+                                       origin_apply = '1 1 0'; // sixth occupant sits in the front-right\r
+                                       break;\r
+                               case 6:\r
+                                       origin_apply = '-1 1 0'; // seventh occupant sits in the back-right\r
+                                       break;\r
+                               case 7:\r
+                                       origin_apply = '1 -1 0'; // eigth occupant sits in the front-left\r
+                                       break;\r
+                               case 8:\r
+                                       origin_apply = '-1 -1 0'; // ninth occupant sits in the back-left\r
                                        break;\r
                                default:\r
                                        break;\r