Merge remote-tracking branch 'origin/terencehill/freezetag_fixes'
authorJakob MG <jakob_mg@hotmail.com>
Thu, 23 Aug 2012 19:43:12 +0000 (21:43 +0200)
committerJakob MG <jakob_mg@hotmail.com>
Thu, 23 Aug 2012 19:43:12 +0000 (21:43 +0200)
Conflicts:
qcsrc/server/cl_client.qc

qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/mutators/gamemode_freezetag.qc

index 7c3308041e670a8270eca36b9a660a640746a6e0..391bff6829be36236d585090d5a5b0392218728a 100644 (file)
@@ -2800,7 +2800,7 @@ void PlayerPreThink (void)
                self.prevorigin = self.origin;
 
                if (!self.vehicle)
-               if (((self.BUTTON_CROUCH && !self.hook.state) || self.health <= g_bloodloss) && self.animstate_startframe != self.anim_melee_x) // prevent crouching if using melee attack
+               if (((self.BUTTON_CROUCH && !self.hook.state) || self.health <= g_bloodloss) && self.animstate_startframe != self.anim_melee_x && !self.freezetag_frozen) // prevent crouching if using melee attack
                {
                        if (!self.crouch)
                        {
index 51bfc62c6382a3fcf3c64e5aa22e4ebb8812c654..3e2268d89748d1eb193892407968c8ee721f66a5 100644 (file)
@@ -1074,7 +1074,7 @@ void SV_PlayerPhysics()
                        PM_Accelerate(wishdir, wishspeed, wishspeed, autocvar_sv_accelerate*maxspd_mod, 1, 0, 0, 0);
                }
        }
-       else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO))
+       else if ((self.items & IT_JETPACK) && self.BUTTON_HOOK && (!autocvar_g_jetpack_fuel || self.ammo_fuel >= 0.01 || self.items & IT_UNLIMITED_WEAPON_AMMO) && !self.freezetag_frozen)
        {
                //makevectors(self.v_angle_y * '0 1 0');
                makevectors(self.v_angle);
@@ -1176,7 +1176,7 @@ void SV_PlayerPhysics()
        else if (self.flags & FL_ONGROUND)
        {
                // we get here if we ran out of ammo
-               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32))
+               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
                        sprint(self, "You don't have any fuel for the ^2Jetpack\n");
 
                // walking
@@ -1259,7 +1259,7 @@ void SV_PlayerPhysics()
        {
                float wishspeed0;
                // we get here if we ran out of ammo
-               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32))
+               if((self.items & IT_JETPACK) && self.BUTTON_HOOK && !(buttons_prev & 32) && self.ammo_fuel < 0.01)
                        sprint(self, "You don't have any fuel for the ^2Jetpack\n");
 
                if(maxspd_mod < 1)
index b57c18a17872ccb4552e73398b03b1c00b2aadc1..608d3595952d42717cbbecf349f38a51944cac1d 100644 (file)
@@ -272,7 +272,9 @@ void player_anim (void)
 
        if (!self.animstate_override)
        {
-               if (!(self.flags & FL_ONGROUND) || self.BUTTON_JUMP)
+               if (self.freezetag_frozen)
+                       setanim(self, self.anim_idle, TRUE, FALSE, FALSE);
+               else if (!(self.flags & FL_ONGROUND) || self.BUTTON_JUMP)
                {
                        if (self.crouch)
                        {
index 2a2ae9ee2900fea47c6d90233a5fbae180281d96..df75dfa122e2ab965be708f4b42ae3d8fbad03cb 100644 (file)
@@ -27,7 +27,7 @@ void freezetag_CheckWinner()
 
        FOR_EACH_PLAYER(e)
        {
-               if(e.freezetag_frozen == 0 && e.classname == "player" && e.health >= 1) // here's one player from the winning team... good
+               if(e.freezetag_frozen == 0 && e.health >= 1) // here's one player from the winning team... good
                {
                        winner = e;
                        break; // break, we found the winner
@@ -131,7 +131,7 @@ void freezetag_Unfreeze(entity attacker)
 
 MUTATOR_HOOKFUNCTION(freezetag_RemovePlayer)
 {
-       if(self.freezetag_frozen == 0)
+       if(self.freezetag_frozen == 0 && self.health >= 1)
        {
                if(self.team == COLOR_TEAM1)
                        --redalive;
@@ -166,22 +166,21 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
                        --pinkalive;
                --totalalive;
 
-        freezetag_Freeze(frag_attacker);
+               freezetag_Freeze(frag_attacker);
        }
 
-    if(frag_attacker.classname == STR_PLAYER)
-        centerprint(frag_attacker, strcat("^2You froze ^7", frag_target.netname, ".\n"));
-
        if(frag_attacker == frag_target || frag_attacker == world)
        {
-        if(frag_target.classname == STR_PLAYER)
-            centerprint(frag_target, "^1You froze yourself.\n");
+               if(frag_target.classname == STR_PLAYER)
+                       centerprint(frag_target, "^1You froze yourself.\n");
                bprint("^7", frag_target.netname, "^1 froze himself.\n");
        }
        else
        {
-        if(frag_target.classname == STR_PLAYER)
-            centerprint(frag_target, strcat("^1You were frozen by ^7", frag_attacker.netname, ".\n"));
+               if(frag_target.classname == STR_PLAYER)
+                       centerprint(frag_target, strcat("^1You were frozen by ^7", frag_attacker.netname, ".\n"));
+               if(frag_attacker.classname == STR_PLAYER)
+                       centerprint(frag_attacker, strcat("^2You froze ^7", frag_target.netname, ".\n"));
                bprint("^7", frag_target.netname, "^1 was frozen by ^7", frag_attacker.netname, ".\n");
        }
 
@@ -194,7 +193,7 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
 
 MUTATOR_HOOKFUNCTION(freezetag_PlayerSpawn)
 {
-    freezetag_Unfreeze(world); // start by making sure that all ice blocks are removed
+       freezetag_Unfreeze(world); // start by making sure that all ice blocks are removed
 
        if(total_players == 1 && time > game_starttime) // only one player active on server, start a new match immediately
        if(!next_round && warmup && (time < warmup - autocvar_g_freezetag_warmup || time > warmup)) // not awaiting next round