]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Size also determines the distance from which you can swallow other players now
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 10:51:01 +0000 (13:51 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 2 May 2011 10:51:01 +0000 (13:51 +0300)
data/qcsrc/server/vore.qc

index 9837a563848b0081e3378a66139958a325aeb7d3..f389d22d7b0cff77f6a7ba88c1e70f2c2bc6778d 100644 (file)
@@ -12,11 +12,16 @@ entity Swallow_player_check()
 {\r
        // check if we can swallow a player instead of firing our weapon\r
 \r
+       float swallow_range;\r
        vector vore_w_shotorg, vore_w_shotdir;\r
+\r
+       swallow_range = cvar("g_balance_vore_swallow_range");\r
+       if(self.scale) // we can swallow from further or closer based on our size\r
+               swallow_range *= self.scale;\r
        vore_w_shotorg = self.origin + self.view_ofs;\r
        vore_w_shotdir = v_forward;\r
 \r
-       WarpZone_traceline_antilag(self, vore_w_shotorg, vore_w_shotorg + vore_w_shotdir * cvar("g_balance_vore_swallow_range"), FALSE, self, ANTILAG_LATENCY(self));\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