]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Purge self from PlayerDies
authorMario <mario@smbclan.net>
Wed, 6 Jan 2016 04:27:30 +0000 (14:27 +1000)
committerMario <mario@smbclan.net>
Wed, 6 Jan 2016 04:27:30 +0000 (14:27 +1000)
16 files changed:
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/gamemodes/gamemode/onslaught/onslaught.qc
qcsrc/common/mutators/mutator/buffs/buffs.qc
qcsrc/common/mutators/mutator/campcheck/campcheck.qc
qcsrc/common/mutators/mutator/overkill/overkill.qc
qcsrc/common/mutators/mutator/pinata/pinata.qc
qcsrc/common/mutators/mutator/spawn_near_teammate/spawn_near_teammate.qc
qcsrc/common/mutators/mutator/superspec/superspec.qc
qcsrc/server/cl_player.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc
qcsrc/server/mutators/mutator/gamemode_cts.qc
qcsrc/server/mutators/mutator/gamemode_freezetag.qc
qcsrc/server/mutators/mutator/gamemode_keepaway.qc
qcsrc/server/mutators/mutator/gamemode_keyhunt.qc
qcsrc/server/mutators/mutator/gamemode_lms.qc
qcsrc/server/mutators/mutator/gamemode_race.qc

index 1630163af36386080588dbc63f55817f622eca3a..d1ac1b40ab54be7af3b62ff6bee1b6cecf686734 100644 (file)
@@ -908,8 +908,8 @@ MUTATOR_HOOKFUNCTION(nb, ClientDisconnect)
 }
 
 MUTATOR_HOOKFUNCTION(nb, PlayerDies)
-{SELFPARAM();
-       nb_DropBall(self);
+{
+       nb_DropBall(frag_target);
        return false;
 }
 
index b4d7672957c92893beea1e49ad07f756c1cc98c0..6f246d905d4f5396c36fb8de36c928c4327dd529 100644 (file)
@@ -1688,16 +1688,16 @@ entity ons_Nearest_ControlPoint_2D(vector pos, float max_dist)
        return closest_target;
 }
 /**
- * find the number of control points and generators in the same team as self
+ * find the number of control points and generators in the same team as this
  */
-int ons_Count_SelfControlPoints()
-{SELFPARAM();
+int ons_Count_SelfControlPoints(entity this)
+{
        entity tmp_entity;
        tmp_entity = findchain(classname, "onslaught_controlpoint");
        int n = 0;
        while(tmp_entity)
        {
-               if(SAME_TEAM(tmp_entity, self))
+               if(SAME_TEAM(tmp_entity, this))
                if(tmp_entity.iscaptured)
                        n++;
                tmp_entity = tmp_entity.chain;
@@ -1705,7 +1705,7 @@ int ons_Count_SelfControlPoints()
        tmp_entity = findchain(classname, "onslaught_generator");
        while(tmp_entity)
        {
-               if(SAME_TEAM(tmp_entity, self))
+               if(SAME_TEAM(tmp_entity, this))
                        n++;
                tmp_entity = tmp_entity.chain;
        }
@@ -1936,8 +1936,8 @@ MUTATOR_HOOKFUNCTION(ons, PlayerDies)
        }
 
        if ( autocvar_g_onslaught_spawn_choose )
-       if ( ons_Count_SelfControlPoints() > 1 )
-               stuffcmd(self, "qc_cmd_cl hud clickradar\n");
+       if ( ons_Count_SelfControlPoints(frag_target) > 1 )
+               stuffcmd(frag_target, "qc_cmd_cl hud clickradar\n");
 
        return false;
 }
index 32fe2d87dfdfffabd95453302a629662ff0c85ad..117d2dbaa5d6bfc13cc81867df9f8a643a30e621 100644 (file)
@@ -656,17 +656,17 @@ MUTATOR_HOOKFUNCTION(buffs, MonsterMove)
 }
 
 MUTATOR_HOOKFUNCTION(buffs, PlayerDies)
-{SELFPARAM();
-       if(self.buffs)
+{
+       if(frag_target.buffs)
        {
-               int buffid = buff_FirstFromFlags(self.buffs).m_id;
-               Send_Notification(NOTIF_ALL_EXCEPT, self, MSG_INFO, INFO_ITEM_BUFF_LOST, self.netname, buffid);
-               self.buffs = 0;
+               int buffid = buff_FirstFromFlags(frag_target.buffs).m_id;
+               Send_Notification(NOTIF_ALL_EXCEPT, frag_target, MSG_INFO, INFO_ITEM_BUFF_LOST, frag_target.netname, buffid);
+               frag_target.buffs = 0;
 
-               if(self.buff_model)
+               if(frag_target.buff_model)
                {
-                       remove(self.buff_model);
-                       self.buff_model = world;
+                       remove(frag_target.buff_model);
+                       frag_target.buff_model = world;
                }
        }
        return false;
index 01d3885770b2b870279e4ca6466b952085311e2e..4916464a1be8dc0e5705d9eebaa801628eb40fae 100644 (file)
@@ -9,9 +9,8 @@ REGISTER_MUTATOR(campcheck, cvar("g_campcheck"));
 .float campcheck_traveled_distance;
 
 MUTATOR_HOOKFUNCTION(campcheck, PlayerDies)
-{SELFPARAM();
-       Kill_Notification(NOTIF_ONE, self, MSG_CENTER_CPID, CPID_CAMPCHECK);
-
+{
+       Kill_Notification(NOTIF_ONE, frag_target, MSG_CENTER_CPID, CPID_CAMPCHECK);
        return false;
 }
 
index 3645053c3841286bfc33c67ccb25447e55593e55..f0db0836abce571180cbce94e112276f0db16ccb 100644 (file)
@@ -113,18 +113,17 @@ MUTATOR_HOOKFUNCTION(ok, PlayerDamage_Calculate, CBC_ORDER_LAST)
 }
 
 MUTATOR_HOOKFUNCTION(ok, PlayerDamage_SplitHealthArmor)
-{SELFPARAM();
+{
        if(damage_take)
-               self.ok_pauseregen_finished = max(self.ok_pauseregen_finished, time + 2);
+               frag_target.ok_pauseregen_finished = max(frag_target.ok_pauseregen_finished, time + 2);
        return false;
 }
 
 MUTATOR_HOOKFUNCTION(ok, PlayerDies)
 {
-       SELFPARAM();
        entity targ = ((frag_attacker) ? frag_attacker : frag_target);
 
-       if(IS_MONSTER(this))
+       if(IS_MONSTER(frag_target))
        {
                remove(other); // remove default item
                other = NULL;
@@ -140,10 +139,10 @@ MUTATOR_HOOKFUNCTION(ok, PlayerDies)
        e.gravity = 1;
        e.reset = SUB_Remove;
        setorigin(e, frag_target.origin + '0 0 32');
-       e.velocity = '0 0 200' + normalize(targ.origin - self.origin) * 500;
+       e.velocity = '0 0 200' + normalize(targ.origin - frag_target.origin) * 500;
        SUB_SetFade(e, time + 5, 1);
 
-       this.ok_lastwep = PS(this).m_switchweapon.m_id;
+       frag_target.ok_lastwep = PS(frag_target).m_switchweapon.m_id;
 
        return false;
 }
index d9b7666c63301d3bebf8f24b759b4a3f544a819d..22ab9acae3d2193382a240a10c69556ae6d17d36 100644 (file)
@@ -2,12 +2,12 @@
 REGISTER_MUTATOR(pinata, cvar("g_pinata") && !cvar("g_instagib") && !cvar("g_overkill"));
 
 MUTATOR_HOOKFUNCTION(pinata, PlayerDies)
-{SELFPARAM();
+{
        FOREACH(Weapons, it != WEP_Null, LAMBDA(
-               if(self.weapons & WepSet_FromWeapon(it))
-               if(PS(self).m_switchweapon != it)
+               if(frag_target.weapons & WepSet_FromWeapon(it))
+               if(PS(frag_target).m_switchweapon != it)
                if(W_IsWeaponThrowable(it.m_id))
-                       W_ThrowNewWeapon(self, it.m_id, false, CENTER_OR_VIEWOFS(self), randomvec() * 175 + '0 0 325');
+                       W_ThrowNewWeapon(frag_target, it.m_id, false, CENTER_OR_VIEWOFS(frag_target), randomvec() * 175 + '0 0 325');
        ));
 
        return true;
index 168a06d2e568cb2f35247551ded00019cae6550d..d94cb53974c3e315d612589686bc512eb0aded22 100644 (file)
@@ -159,8 +159,8 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
 }
 
 MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerDies)
-{SELFPARAM();
-       self.msnt_deathloc = self.origin;
+{
+       frag_target.msnt_deathloc = frag_target.origin;
        return 0;
 }
 
index ed1f37b59bdbbc45fcc16c26321b896f75376853..b7a596cdf235e44efaecd244cf67280ebe13c619 100644 (file)
@@ -439,10 +439,10 @@ MUTATOR_HOOKFUNCTION(superspec, ClientConnect)
 }
 
 MUTATOR_HOOKFUNCTION(superspec, PlayerDies)
-{SELFPARAM();
+{
        FOREACH_CLIENT(IS_SPEC(it), LAMBDA(
                setself(it);
-               if(self.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && self.enemy == this)
+               if(self.autospec_flags & ASF_FOLLOWKILLER && IS_PLAYER(frag_attacker) && self.enemy == frag_target)
                {
                        if(self.autospec_flags & ASF_SHOWWHAT)
                                superspec_msg("", "", self, sprintf("^7Following %s^7 due to followkiller\n", frag_attacker.netname), 2);
@@ -451,7 +451,7 @@ MUTATOR_HOOKFUNCTION(superspec, PlayerDies)
                }
        ));
 
-       setself(this);
+       setself(frag_target);
        return false;
 }
 
index 0e16fac3381eecee5baa4e551ffca2a1e99fb9bb..c6b0359c4ee89bd20f3b05de8df71eae2c251f7f 100644 (file)
@@ -543,7 +543,7 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
        if(accuracy_isgooddamage(attacker, this))
         attacker.accuracy.(accuracy_frags[w.m_id-1]) += 1;
 
-               WITH(entity, self, this, MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype));
+               MUTATOR_CALLHOOK(PlayerDies, inflictor, attacker, this, deathtype);
                excess = frag_damage;
 
                Weapon wep = PS(this).m_weapon;
index e2056a407e14b72e679e1c6e6d9a362f77e1cb52..c43eb88e0e8c77e461259534019d40177e0e399a 100644 (file)
@@ -292,10 +292,10 @@ void ca_LastPlayerForTeam_Notify()
 }
 
 MUTATOR_HOOKFUNCTION(ca, PlayerDies)
-{SELFPARAM();
+{
        ca_LastPlayerForTeam_Notify();
        if(!allowed_to_spawn)
-               self.respawn_flags =  RESPAWN_SILENT;
+               frag_target.respawn_flags =  RESPAWN_SILENT;
        if(!warmup_stage)
                eliminatedPlayers.SendFlags |= 1;
        return 1;
index 1ce78a1f74b60e27a233bb4210d1cf458c5f2062..fed9a89201290d7290ed098e3de358d0670972d9 100644 (file)
@@ -281,9 +281,9 @@ MUTATOR_HOOKFUNCTION(cts, PutClientInServer)
 }
 
 MUTATOR_HOOKFUNCTION(cts, PlayerDies)
-{SELFPARAM();
-       self.respawn_flags |= RESPAWN_FORCE;
-       race_AbandonRaceCheck(self);
+{
+       frag_target.respawn_flags |= RESPAWN_FORCE;
+       race_AbandonRaceCheck(frag_target);
        return false;
 }
 
index 7dd7e67c556afa418b5abb5baaea4154470560d7..abc5d8c5af7206c33901bf9952ec7586c136f344 100644 (file)
@@ -376,12 +376,12 @@ MUTATOR_HOOKFUNCTION(ft, MakePlayerObserver)
 }
 
 MUTATOR_HOOKFUNCTION(ft, PlayerDies)
-{SELFPARAM();
+{
        if(round_handler_IsActive())
        if(round_handler_CountdownRunning())
        {
-               if(STAT(FROZEN, self))
-                       freezetag_Unfreeze(world);
+               if(STAT(FROZEN, frag_target))
+                       WITH(entity, self, frag_target, freezetag_Unfreeze(world));
                freezetag_count_alive_players();
                return 1; // let the player die so that he can respawn whenever he wants
        }
@@ -392,23 +392,23 @@ MUTATOR_HOOKFUNCTION(ft, PlayerDies)
                || frag_deathtype == DEATH_TEAMCHANGE.m_id || frag_deathtype == DEATH_AUTOTEAMCHANGE.m_id)
        {
                // let the player die, he will be automatically frozen when he respawns
-               if(STAT(FROZEN, self) != 1)
+               if(STAT(FROZEN, frag_target) != 1)
                {
                        freezetag_Add_Score(frag_attacker);
                        freezetag_count_alive_players();
                        freezetag_LastPlayerForTeam_Notify();
                }
                else
-                       freezetag_Unfreeze(world); // remove ice
-               self.health = 0; // Unfreeze resets health
-               self.freezetag_frozen_timeout = -2; // freeze on respawn
+                       WITH(entity, self, frag_target, freezetag_Unfreeze(world)); // remove ice
+               frag_target.health = 0; // Unfreeze resets health
+               frag_target.freezetag_frozen_timeout = -2; // freeze on respawn
                return 1;
        }
 
-       if(STAT(FROZEN, self))
+       if(STAT(FROZEN, frag_target))
                return 1;
 
-       freezetag_Freeze(frag_attacker);
+       WITH(entity, self, frag_target, freezetag_Freeze(frag_attacker));
        freezetag_LastPlayerForTeam_Notify();
 
        if(frag_attacker == frag_target || frag_attacker == world)
index 8659a98070255d2c009b7966a266fac12a696815..073631e702ebd346a8aabf7c2e9bb95c327c8207 100644 (file)
@@ -313,7 +313,7 @@ void havocbot_role_ka_collector()
 // ==============
 
 MUTATOR_HOOKFUNCTION(ka, PlayerDies)
-{SELFPARAM();
+{
        if((frag_attacker != frag_target) && (IS_PLAYER(frag_attacker)))
        {
                if(frag_target.ballcarried) { // add to amount of times killing carrier
@@ -329,7 +329,7 @@ MUTATOR_HOOKFUNCTION(ka, PlayerDies)
                        PlayerScore_Add(frag_attacker, SP_SCORE, autocvar_g_keepaway_score_killac);
        }
 
-       if(self.ballcarried) { ka_DropEvent(self); } // a player with the ball has died, drop it
+       if(frag_target.ballcarried) { ka_DropEvent(frag_target); } // a player with the ball has died, drop it
        return 0;
 }
 
index 09a029984c7a2b9fea3f422bdf4fb27d73615a44..6f8ec9551bee113a88dbf955db8b2e5a7e100ed5 100644 (file)
@@ -1301,13 +1301,13 @@ MUTATOR_HOOKFUNCTION(kh, MakePlayerObserver)
 }
 
 MUTATOR_HOOKFUNCTION(kh, PlayerDies)
-{SELFPARAM();
-       if(self == other)
-               kh_Key_DropAll(self, true);
+{
+       if(frag_target == other)
+               kh_Key_DropAll(frag_target, true);
        else if(IS_PLAYER(other))
-               kh_Key_DropAll(self, false);
+               kh_Key_DropAll(frag_target, false);
        else
-               kh_Key_DropAll(self, true);
+               kh_Key_DropAll(frag_target, true);
        return 0;
 }
 
index 9d82004e2758426d40c36a0215c766dc16f5bc48..77f6b6ca80ee20e22cc19c19a208c1eff2c87514 100644 (file)
@@ -177,9 +177,8 @@ MUTATOR_HOOKFUNCTION(lms, PutClientInServer)
 }
 
 MUTATOR_HOOKFUNCTION(lms, PlayerDies)
-{SELFPARAM();
-       self.respawn_flags |= RESPAWN_FORCE;
-
+{
+       frag_target.respawn_flags |= RESPAWN_FORCE;
        return false;
 }
 
index 9d2dcbf4aa22b0ad62217dd059d62981f06eda68..03ee6eaf97c95b74c9c880d363d647f9bee24db2 100644 (file)
@@ -321,9 +321,9 @@ MUTATOR_HOOKFUNCTION(rc, PutClientInServer)
 }
 
 MUTATOR_HOOKFUNCTION(rc, PlayerDies)
-{SELFPARAM();
-       self.respawn_flags |= RESPAWN_FORCE;
-       race_AbandonRaceCheck(self);
+{
+       frag_target.respawn_flags |= RESPAWN_FORCE;
+       race_AbandonRaceCheck(frag_target);
        return false;
 }