Batfoxkid / Freak-Fortress-2-Rewrite

The gamemode that's now also a standalone boss maker.
https://forums.alliedmods.net/forumdisplay.php?f=154
GNU General Public License v3.0
17 stars 7 forks source link

[Bug] ff2r_default_abilities: Fix rage_cloneattack making same players minions twice #200

Closed naydef closed 1 month ago

naydef commented 4 months ago

The array which hold player indexes must be reset before acquiring new targets. Without it, when the number of players to spawn is less than the available players, some players become minions twice (which makes them suicide as well as breaking teamswitch on death)

Diff:

@@ -2629,6 +2629,7 @@ void Rage_CloneAttack(int client, ConfigData cfg)
                SpawnCloneList(victim, victims, amount, minion, owner, team, pos, rival, teleToSpawn);
        }

+       victims = 0;
        if(amount)
        {
            for(int target = 1; target <= MaxClients; target++)
@@ -2651,6 +2652,7 @@ void Rage_CloneAttack(int client, ConfigData cfg)
            if(victims)
                SpawnCloneList(victim, victims, amount, minion, owner, team, pos, rival, teleToSpawn);

+           victims = 0;
            if(amount)
            {
                for(int target = 1; target <= MaxClients; target++)