]> de.git.xonotic.org Git - voretournament/voretournament.git/blobdiff - data/qcsrc/server/vore.qc
Use a different, and very weird solution for the prey scan issue in multiplayer....
[voretournament/voretournament.git] / data / qcsrc / server / vore.qc
index 8dcdb92a02ebd4efc1e4d23d2cf8c391e3f9852d..74a6fb1e8e806ea58160d74181e885bf2932756a 100644 (file)
@@ -1,4 +1,3 @@
-float vore_frametime;\r
 .float regurgitate_prepare;\r
 .float stomachkick_delay, system_delay, action_delay, digest_button_delay_time, regurgitate_button_delay_time;\r
 .float complain_vore;\r
 .float regurgitate_prepare;\r
 .float stomachkick_delay, system_delay, action_delay, digest_button_delay_time, regurgitate_button_delay_time;\r
 .float complain_vore;\r
@@ -22,7 +21,10 @@ entity Swallow_player_check()
        vore_w_shotorg = self.origin;\r
        vore_w_shotdir = v_forward;\r
 \r
        vore_w_shotorg = self.origin;\r
        vore_w_shotdir = v_forward;\r
 \r
-       WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * swallow_range, FALSE, self, ANTILAG_LATENCY(self));\r
+       if(self.antilag_debug)\r
+               WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * swallow_range, FALSE, self, self.antilag_debug);\r
+       else\r
+               WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * swallow_range, FALSE, self, ANTILAG_LATENCY(self));\r
        if(trace_fraction < 1)\r
        if(trace_ent.classname == "player")\r
                return trace_ent;\r
        if(trace_fraction < 1)\r
        if(trace_ent.classname == "player")\r
                return trace_ent;\r
@@ -660,14 +662,11 @@ void Vore_SetSbarRings()
        }\r
 }\r
 \r
        }\r
 }\r
 \r
+.entity prey;\r
 void Vore()\r
 {\r
        // main vore code, this is where it all happens\r
 \r
 void Vore()\r
 {\r
        // main vore code, this is where it all happens\r
 \r
-       if(vore_frametime > time) //account system frametime\r
-               return;\r
-       vore_frametime = time + sys_frametime;\r
-\r
        Vore_AutoTaunt();\r
 \r
        // wash the goo away from players once they leave the stomach\r
        Vore_AutoTaunt();\r
 \r
        // wash the goo away from players once they leave the stomach\r
@@ -766,23 +765,24 @@ void Vore()
 // Code that addresses predators:\r
 // --------------------------------\r
 \r
 // Code that addresses predators:\r
 // --------------------------------\r
 \r
-       entity prey;\r
-       prey = Swallow_player_check();\r
+       // only scan prey between server frames, else we get major breakage in multiplayer and jitter\r
+       if(!frametime)\r
+               self.prey = Swallow_player_check();\r
 \r
        // attempt to swallow our new prey if we pressed the attack button, and there's any in range\r
        self.stat_canswallow = 0;\r
 \r
        // attempt to swallow our new prey if we pressed the attack button, and there's any in range\r
        self.stat_canswallow = 0;\r
-       if(Swallow_condition_check(prey))\r
+       if(Swallow_condition_check(self.prey))\r
        {\r
                // canswallow stat, used by the HUD\r
        {\r
                // canswallow stat, used by the HUD\r
-               if(teams_matter && prey.team == self.team)\r
+               if(teams_matter && self.prey.team == self.team)\r
                        self.stat_canswallow = 2;\r
                else\r
                        self.stat_canswallow = 1;\r
 \r
                if(self.BUTTON_ATCK)\r
                        self.stat_canswallow = 2;\r
                else\r
                        self.stat_canswallow = 1;\r
 \r
                if(self.BUTTON_ATCK)\r
-                       Vore_SwallowStep(prey);\r
+                       Vore_SwallowStep(self.prey);\r
        }\r
        }\r
-       else if(prey != world)\r
+       else if(self.prey != world)\r
                self.stat_canswallow = -1;\r
 \r
        // toggle digestion, if the player has someone in their stomach\r
                self.stat_canswallow = -1;\r
 \r
        // toggle digestion, if the player has someone in their stomach\r