From 778a4e8275888617ffabbfe09a5904be8a54d0e7 Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Sat, 16 Jul 2011 17:36:50 +0300 Subject: [PATCH] Finally fix the prey scanning issue! I was forgetting to use makevectors() to generate the player's angles, and was using v_forward with angles generated at random from all around the code. HOW COULD I HAVE BEEN SO STUPID D: --- data/qcsrc/client/View.qc | 5 ----- data/qcsrc/server/vore.qc | 13 +++++++------ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index 1ab5b7ea..c5d359ad 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -203,11 +203,6 @@ float TrueAimCheck() ta = trueaim; mv = MOVE_NOMONSTERS; - switch(activeweapon) - { - case WEP_GRABBER: // no trueaim - } - vecs = decompressShotOrigin(getstati(STAT_SHOTORG)); traceline(view_origin, view_origin + view_forward * MAX_SHOT_DISTANCE, mv, ta); diff --git a/data/qcsrc/server/vore.qc b/data/qcsrc/server/vore.qc index 76dca406..cda4791e 100644 --- a/data/qcsrc/server/vore.qc +++ b/data/qcsrc/server/vore.qc @@ -18,6 +18,7 @@ entity Swallow_player_check() swallow_range = cvar("g_balance_vore_swallow_range"); if(cvar("g_healthsize")) // we can swallow from further or closer based on our size swallow_range *= self.scale; + makevectors(self.angles); vore_w_shotorg = self.origin; vore_w_shotdir = v_forward; @@ -662,7 +663,6 @@ void Vore_SetSbarRings() } } -.entity prey; void Vore() { // main vore code, this is where it all happens @@ -765,22 +765,23 @@ void Vore() // Code that addresses predators: // -------------------------------- - self.prey = Swallow_player_check(); + entity prey; + prey = Swallow_player_check(); // attempt to swallow our new prey if we pressed the attack button, and there's any in range self.stat_canswallow = 0; - if(Swallow_condition_check(self.prey)) + if(Swallow_condition_check(prey)) { // canswallow stat, used by the HUD - if(teams_matter && self.prey.team == self.team) + if(teams_matter && prey.team == self.team) self.stat_canswallow = 2; else self.stat_canswallow = 1; if(self.BUTTON_ATCK) - Vore_SwallowStep(self.prey); + Vore_SwallowStep(prey); } - else if(self.prey != world) + else if(prey != world) self.stat_canswallow = -1; // toggle digestion, if the player has someone in their stomach -- 2.39.2