From b72ea6720550c8a4104a324e465287533eb67e27 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Wed, 4 May 2011 02:27:17 +0300 Subject: [PATCH] More tweaks to the prey positioning code --- data/qcsrc/server/vore.qc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index e95332a5..f9476c0b 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -98,20 +98,22 @@ float Vore_CanLeave() // position the camera properly for prey void Vore_SetPreyPositions() { + // self is the predator and head is the prey + local entity head; local vector oldforward, oldright, oldup; - local float position_counter; local vector origin_apply; + local float position_counter; + oldforward = v_forward; oldright = v_right; oldup = v_up; - makevectors(self.v_angle); // In order to allow prey to see each other in the stomach, we must position each occupant differently, - // else all players would overlap in the center. To do this, we run a loop on all players in the same stomach. + // else all players overlap in the center. To do this, we run a loop on all players in the same stomach. // For each player, the origin is updated, then a new origin is used for the next player. - // This requires that no more than 9 players can be in a stomach at a time! + // This requires that no more than 9 players may be in the stomach at a time! FOR_EACH_PLAYER(head) { if(head.predator == self) @@ -148,10 +150,12 @@ void Vore_SetPreyPositions() default: break; } + // since prey have their predators set as an aiment, view_ofs will specify the real origin of prey, not just the view offset origin_apply_x *= v_forward_x; // position depends on the predator's rotation origin_apply_y *= v_forward_y; // position depends on the predator's rotation head.view_ofs = PL_PREY_VIEW_OFS + origin_apply * cvar("g_vore_neighborprey_distance"); + position_counter += 1; } } -- 2.39.2