]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
More tweaks to the prey positioning code
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index e95332a50e9652f27ae28e8edd2effecd589505a..f9476c0b2eaec4c633a8079568075de7b4fe5c60 100644 (file)
@@ -98,20 +98,22 @@ float Vore_CanLeave()
 // position the camera properly for prey\r
 void Vore_SetPreyPositions()\r
 {\r
+       // self is the predator and head is the prey\r
+\r
        local entity head;\r
        local vector oldforward, oldright, oldup;\r
-       local float position_counter;\r
        local vector origin_apply;\r
+       local float position_counter;\r
+\r
        oldforward = v_forward;\r
        oldright = v_right;\r
        oldup = v_up;\r
-\r
        makevectors(self.v_angle);\r
 \r
        // In order to allow prey to see each other in the 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
+       // else all players 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.\r
-       // This requires that no more than 9 players can be in a stomach at a time!\r
+       // This requires that no more than 9 players may be in the stomach at a time!\r
        FOR_EACH_PLAYER(head)\r
        {\r
                if(head.predator == self)\r
@@ -148,10 +150,12 @@ void Vore_SetPreyPositions()
                                default:\r
                                        break;\r
                        }\r
+\r
                        // since prey have their predators set as an aiment, view_ofs will specify the real origin of prey, not just the view offset\r
                        origin_apply_x *= v_forward_x; // position depends on the predator's rotation\r
                        origin_apply_y *= v_forward_y; // position depends on the predator's rotation\r
                        head.view_ofs = PL_PREY_VIEW_OFS + origin_apply * cvar("g_vore_neighborprey_distance");\r
+\r
                        position_counter += 1;\r
                }\r
        }\r