]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Freeze Tag: instantly respawn players who died when round hasn't started yet
authorterencehill <piuntn@gmail.com>
Sat, 23 Mar 2019 14:10:38 +0000 (15:10 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 23 Mar 2019 14:10:38 +0000 (15:10 +0100)
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/server/constants.qh

index d38becd7373e3cb77f6288deb11751a4bee14014..2dfcf48112447ad1a5411a60b3c5f925e567b3b2 100644 (file)
@@ -361,7 +361,9 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies)
                if (STAT(FROZEN, frag_target) == FROZEN_NORMAL)
                        Unfreeze(frag_target, true);
                freezetag_count_alive_players();
-               return true; // let the player die so that he can respawn whenever he wants
+               frag_target.respawn_time = time;
+               frag_target.respawn_flags |= RESPAWN_FORCE;
+               return true;
        }
 
        // Cases DEATH_TEAMCHANGE and DEATH_AUTOTEAMCHANGE are needed to fix a bug whe
index f98d586fb504cf389b764fb704360713d5a2148f..62a15f680c1cb8117c68385a5f6e4119a50c16d3 100644 (file)
@@ -10,9 +10,9 @@ const int FL_PICKUPITEMS = BIT(19);
 
 const int SVC_SETVIEW = 5;
 
-const int RESPAWN_FORCE = 1;
-const int RESPAWN_SILENT = 2;
-const int RESPAWN_DENY = 4;
+const int RESPAWN_FORCE = BIT(0);
+const int RESPAWN_SILENT = BIT(1);
+const int RESPAWN_DENY = BIT(2);
 
 #define EFMASK_CHEAP (EF_ADDITIVE | EF_DOUBLESIDED | EF_FULLBRIGHT | EF_NODEPTHTEST | EF_NODRAW | EF_NOGUNBOB | EF_NOSHADOW | EF_LOWPRECISION | EF_SELECTABLE | EF_TELEPORT_BIT)