]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/mutators/mutator/gamemode_ctf.qc
Merge branch 'terencehill/menu_fixes' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / mutators / mutator / gamemode_ctf.qc
index ba1e7a84fbc4a985befefcffb088af17cc91e46e..702ff45743214da4efcfc61623802c22a9a1f611 100644 (file)
@@ -13,7 +13,7 @@ REGISTER_MUTATOR(ctf, false)
                ctf_Initialize();
 
                ActivateTeamplay();
-               SetLimits(autocvar_capturelimit_override, autocvar_captureleadlimit_override, -1, -1);
+               SetLimits(autocvar_capturelimit_override, autocvar_captureleadlimit_override, autocvar_timelimit_override, -1);
                have_team_spawns = -1; // request team spawns
        }
 
@@ -1158,8 +1158,8 @@ void ctf_Reset(entity this)
        ctf_RespawnFlag(this);
 }
 
-void ctf_DelayedFlagSetup() // called after a flag is placed on a map by ctf_FlagSetup()
-{SELFPARAM();
+void ctf_DelayedFlagSetup(entity this) // called after a flag is placed on a map by ctf_FlagSetup()
+{
        // bot waypoints
        waypoint_spawnforitem_force(self, self.origin);
        self.nearestwaypointtimeout = 0; // activate waypointing again
@@ -1231,16 +1231,18 @@ void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag e
        if (flag.capeffect == "")       { flag.capeffect = EFFECT_CAP(teamnumber).eent_eff_name; }
 
        // sounds
-       flag.snd_flag_taken = strzone(SND(CTF_TAKEN(teamnumber)));
-       flag.snd_flag_returned = strzone(SND(CTF_RETURNED(teamnumber)));
-       flag.snd_flag_capture = strzone(SND(CTF_CAPTURE(teamnumber)));
-       flag.snd_flag_dropped = strzone(SND(CTF_DROPPED(teamnumber)));
-       if (flag.snd_flag_respawn == "") flag.snd_flag_respawn = strzone(SND(CTF_RESPAWN)); // if there is ever a team-based sound for this, update the code to match.
-       precache_sound(flag.snd_flag_respawn);
-       if (flag.snd_flag_touch == "") flag.snd_flag_touch = strzone(SND(CTF_TOUCH)); // again has no team-based sound
-       precache_sound(flag.snd_flag_touch);
-       if (flag.snd_flag_pass == "") flag.snd_flag_pass = strzone(SND(CTF_PASS)); // same story here
-       precache_sound(flag.snd_flag_pass);
+#define X(s,b) \
+               if(flag.s == "") flag.s = b; \
+               precache_sound(flag.s);
+
+       X(snd_flag_taken,               strzone(SND(CTF_TAKEN(teamnumber))))
+       X(snd_flag_returned,    strzone(SND(CTF_RETURNED(teamnumber))))
+       X(snd_flag_capture,     strzone(SND(CTF_CAPTURE(teamnumber))))
+       X(snd_flag_dropped,     strzone(SND(CTF_DROPPED(teamnumber))))
+       X(snd_flag_respawn,     strzone(SND(CTF_RESPAWN)))
+       X(snd_flag_touch,               strzone(SND(CTF_TOUCH)))
+       X(snd_flag_pass,                strzone(SND(CTF_PASS)))
+#undef X
 
        // precache
        precache_model(flag.model);
@@ -2551,10 +2553,10 @@ void ctf_SpawnTeam (string teamname, int teamcolor)
        this.netname = teamname;
        this.cnt = teamcolor;
        this.spawnfunc_checked = true;
-       WITH(entity, self, this, spawnfunc_ctf_team(this));
+       WITHSELF(this, spawnfunc_ctf_team(this));
 }
 
-void ctf_DelayedInit() // Do this check with a delay so we can wait for teams to be set up.
+void ctf_DelayedInit(entity this) // Do this check with a delay so we can wait for teams to be set up.
 {
        ctf_teams = 2;