Merge remote-tracking branch 'origin/DefaultUser/ca_spectator_fix'
authorMario <mario@smbclan.net>
Sun, 3 Jul 2016 23:13:54 +0000 (09:13 +1000)
committerMario <mario@smbclan.net>
Sun, 3 Jul 2016 23:13:54 +0000 (09:13 +1000)
1  2 
qcsrc/server/mutators/mutator/gamemode_ca.qc

@@@ -307,7 -307,7 +307,7 @@@ void ca_LastPlayerForTeam_Notify(entit
  MUTATOR_HOOKFUNCTION(ca, PlayerDies)
  {
        entity frag_target = M_ARGV(2, entity);
-       
        ca_LastPlayerForTeam_Notify(frag_target);
        if (!allowed_to_spawn)
                frag_target.respawn_flags =  RESPAWN_SILENT;
@@@ -340,6 -340,8 +340,8 @@@ MUTATOR_HOOKFUNCTION(ca, MakePlayerObse
                player.caplayer = 0;
        if (player.caplayer)
                player.frags = FRAGS_LMS_LOSER;
+     else
+         player.frags = FRAGS_SPECTATOR;
        if (!warmup_stage)
                eliminatedPlayers.SendFlags |= 1;
        return true;  // prevent team reset
@@@ -439,11 -441,11 +441,11 @@@ MUTATOR_HOOKFUNCTION(ca, SpectateSet
  MUTATOR_HOOKFUNCTION(ca, SpectateNext)
  {
      entity client = M_ARGV(0, entity);
 -    entity targ = M_ARGV(1, entity);
  
        if (!autocvar_g_ca_spectate_enemies && client.caplayer)
        {
 -              targ = CA_SpectateNext(client, targ);
 +              entity targ = M_ARGV(1, entity);
 +              M_ARGV(1, entity) = CA_SpectateNext(client, targ);
                return true;
        }
  }
@@@ -468,8 -470,6 +470,8 @@@ MUTATOR_HOOKFUNCTION(ca, SpectatePrev
                }
        }
  
 +      M_ARGV(1, entity) = targ;
 +
        return MUT_SPECPREV_FOUND;
  }