Patches #1190

Merge in xonotic/xonotic-data.pk3dir.git: terencehill/freezetag_fixes

Added by git-manager almost 2 years ago. Updated over 1 year ago.

Status:ResolvedStart date:04/28/2012
Priority:NormalDue date:
Assignee:tZork% Done:

100%

Category:-
Target version:-

Description

Purpose of the branch:

It fixes some bugs in freezetag, see branch log

Repository: xonotic/xonotic-data.pk3dir.git
Commit: 8ec332c7d3cffdc6b39c3ada385fa41995630589
Branch: terencehill/freezetag_fixes

Merge commands:

cd data/xonotic-data.pk3dir
git checkout master
git reset --hard origin/master
git pull && git diff '8ec332c7d3cffdc6b39c3ada385fa41995630589'..'origin/terencehill/freezetag_fixes'

# please check that the diff you just saw did not contain anything complex that
# needs a new merge request, and review these changes

git merge --no-ff 'origin/terencehill/freezetag_fixes'

# please make sure this merge worked, and if not, fix merge conflicts and git
# commit BEFORE the next command
#
# also, THIS is the point to do final pre-merge testing
#
# use git reset --hard origin/master to bail out

git push && git push --delete origin 'terencehill/freezetag_fixes'

Diffstat:

 qcsrc/server/cl_client.qc                   |    2 +-
 qcsrc/server/cl_physics.qc                  |    6 +++---
 qcsrc/server/cl_player.qc                   |    4 +++-
 qcsrc/server/mutators/gamemode_freezetag.qc |    9 ++++-----
 4 files changed, 11 insertions(+), 10 deletions(-)

Revision log:

commit 8ec332c7d3cffdc6b39c3ada385fa41995630589
Merge: 21ec77d a4ccbd7
Author: terencehill <piuntn@gmail.com>
Commit: terencehill <piuntn@gmail.com>

    Merge branch 'master' into terencehill/freezetag_fixes

commit 21ec77d388ba3f59ca65d8caae40ce73f327ca12
Author: terencehill <piuntn@gmail.com>
Commit: terencehill <piuntn@gmail.com>

    freezetag: forbid crouching when a player is frozen

commit 1776c33992eb921a8cd6aa4ae419d6c827357869
Author: terencehill <piuntn@gmail.com>
Commit: terencehill <piuntn@gmail.com>

    freezetag, fix for this issue: if the player press the jump button when frozen he's not supposed to jump but the jump animation is played even if he actually doesn't jump.

commit 0c03782fac2e6dd7b6e7c3fea9f9d3e0b1343955
Merge: 0a790f8 75f0717
Author: terencehill <piuntn@gmail.com>
Commit: terencehill <piuntn@gmail.com>

    Merge branch 'master' into terencehill/freezetag_fixes

commit 0a790f8167104e104d41a83e26f0fe7dd2220e59
Author: terencehill <piuntn@gmail.com>
Commit: terencehill <piuntn@gmail.com>

    Do not decrease totalalive (players not frozen) when an observer leaves the server as it's already decreased when he becomes observer (freezetag_RemovePlayer is called in MakePlayerObserver and in ClientDisconnect too)

commit 55d648d2f2c3933ffde1ab78115007cce989e493
Author: terencehill <piuntn@gmail.com>
Commit: terencehill <piuntn@gmail.com>

    Freezetag: if you kill yourself don't centerprint the msg "You froze <your name>" too as the msg "You froze yourself" is enough

commit 0ceedba27394ec9dc53e54854e1bd4d77baf09a5
Author: terencehill <piuntn@gmail.com>
Commit: terencehill <piuntn@gmail.com>

    The check e.classname == "player" is redundant within FOR_EACH_PLAYER(e)

commit f949aaf59851f632a58eb822505922beb783812e
Author: terencehill <piuntn@gmail.com>
Commit: terencehill <piuntn@gmail.com>

    Freezetag: Forbid use of the jetpack when frozen

User agreed to the GPLv2+.

Diff:

diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc
index fcc1cca..33b763c 100644
--- a/qcsrc/server/cl_client.qc
+++ b/qcsrc/server/cl_client.qc
@@ -2782,7 +2782,7 @@ void PlayerPreThink (void)

         self.prevorigin = self.origin;

-        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.freezetag_frozen && self.animstate_startframe != self.anim_melee_x) // prevent crouching if using melee attack
         {
             if (!self.crouch)
             {
diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc
index 51bfc62..3e2268d 100644
--- a/qcsrc/server/cl_physics.qc
+++ b/qcsrc/server/cl_physics.qc
@@ -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)
diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc
index fd14d42..b03d8aa 100644
--- a/qcsrc/server/cl_player.qc
+++ b/qcsrc/server/cl_player.qc
@@ -271,7 +271,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)
             {
diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc
index fa5a365..b9364ad 100644
--- a/qcsrc/server/mutators/gamemode_freezetag.qc
+++ b/qcsrc/server/mutators/gamemode_freezetag.qc
@@ -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;
@@ -169,9 +169,6 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
         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)
@@ -182,6 +179,8 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerDies)
     {
         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");
     }

History

#1 Updated by tZork over 1 year ago

  • Status changed from New to Resolved
  • Assignee set to tZork

Merged, thanks.

Also available in: Atom PDF