]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Move the rest of the swallowing code in the right place
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 6 Sep 2010 17:58:02 +0000 (20:58 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 6 Sep 2010 17:58:02 +0000 (20:58 +0300)
data/qcsrc/server/vore.qc

index 4dff84a1d3850fb5e74e51fed25cc49bf33ff4c3..e6cb21e4b3d54f27883241c5019afc526655bebc 100644 (file)
@@ -104,6 +104,7 @@ void Vore_Swallow(entity e)
        e.vore_oldsolid = e.solid;\r
        e.vore_oldview_ofs_z = e.view_ofs_z;\r
 \r
+       e.eater = self;\r
        setorigin(e, e.eater.origin);\r
        e.velocity = '0 0 0';\r
        e.movetype = MOVETYPE_FOLLOW;\r
@@ -121,12 +122,18 @@ void Vore_Swallow(entity e)
        if(stov(cvar_string("g_vore_regurgitatecolor_released")))\r
                e.colormod = stov(cvar_string("g_vore_regurgitatecolor_released"));\r
 \r
+       if(e.eater.team == e.team && teamplay)\r
+               centerprint(e.eater, "^4You have swallowed a team mate, use caution!");\r
+\r
        PlayerSound(e.eater, playersound_swallow, CHAN_PAIN, VOICETYPE_PLAYERSOUND);\r
        setanim(e.eater, e.eater.anim_pain1, FALSE, TRUE, TRUE); // looks good for swallowing / regurgitating\r
        e.eater.stomach_load += 1;\r
        e.eater.regurgitate_prepare = 0;\r
        Vore_Weight_apply(e.eater);\r
 \r
+       // block firing for a small amount of time when voring, or we'll be firing the next frame after we swallow\r
+       e.eater.weapon_delay = time + button_delay;\r
+       e.eater.swallow_delay = time + cvar("g_balance_vore_swallow_delay");\r
        e.system_delay = e.eater.system_delay = time + system_delay_time;\r
 }\r
 \r
@@ -294,17 +301,7 @@ void Vore()
        // attempt to swallow our new prey if there's any in range\r
        if(self.BUTTON_ATCK && !self.BUTTON_REGURGITATE && self.swallow_delay < time)\r
        if(Swallow_condition_check(prey))\r
-       {\r
-               prey.eater = self;\r
                Vore_Swallow(prey);\r
-               self.swallow_delay = time + cvar("g_balance_vore_swallow_delay");\r
-\r
-               if(self.team == prey.team && teamplay)\r
-                       centerprint(self, "You have swallowed a team mate, use caution!");\r
-\r
-               // block firing for a small amount of time when voring, or we'll be firing the next frame after we swallow\r
-               self.weapon_delay = time + 0.25;\r
-       }\r
 \r
        // start / stop digestion on command, if the player has someone in their stomach\r
        if(self.BUTTON_DIGEST)\r