]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix up the Spectate mutator hooks for CA
authorMario <mario@smbclan.net>
Mon, 27 Jun 2016 21:21:41 +0000 (07:21 +1000)
committerMario <mario@smbclan.net>
Mon, 27 Jun 2016 21:21:41 +0000 (07:21 +1000)
qcsrc/server/cl_client.qc
qcsrc/server/mutators/mutator/gamemode_ca.qc

index 733b0935571b9f8b75d33fea219e04fba7c3a074..f2f0f4a35520283f8ec3e4cd09869abd8fd3b57d 100644 (file)
@@ -1735,7 +1735,6 @@ bool SpectatePrev(entity this)
                    ent = M_ARGV(1, entity);
                    break;
                case MUT_SPECPREV_RETURN:
-                   ent = M_ARGV(1, entity);
                    return true;
                case MUT_SPECPREV_CONTINUE:
                default:
index 2a8da29c275210b8646a31ba08bae7a0a6bc3d1f..a581d0fa820af2d1bcf198a13ac80edc02cddb7d 100644 (file)
@@ -439,11 +439,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,6 +468,8 @@ MUTATOR_HOOKFUNCTION(ca, SpectatePrev)
                }
        }
 
+       M_ARGV(1, entity) = targ;
+
        return MUT_SPECPREV_FOUND;
 }