backtrace("Flag carrier had no flag sprite?!?");
}
LogCTF("dropped", p.team, p);
- sound (self, CHAN_TRIGGER, self.noise4, VOL_BASE, ATTN_NONE);
+ sound (p, CH_TRIGGER, self.noise4, VOL_BASE, ATTN_NONE);
setattachment(e, world, "");
e.damageforcescale = autocvar_g_balance_ctf_damageforcescale;
{
bprint("The ", self.netname, " became impatient after ", ftos_decimals(flagcaptimerecord, 2), " seconds and returned itself\n");
- sound (self, CHAN_TRIGGER, self.noise3, VOL_BASE, ATTN_NONE);
+ sound (self, CH_TRIGGER, self.noise3, VOL_BASE, ATTN_NONE);
self.owner.impulse = 141; // returning!
e = self;
if (time > self.pain_finished)
{
bprint("The ", self.netname, " has returned to base\n");
- sound (self, CHAN_TRIGGER, self.noise3, VOL_BASE, ATTN_NONE);
+ sound (self, CH_TRIGGER, self.noise3, VOL_BASE, ATTN_NONE);
LogCTF("returned", self.team, world);
ReturnFlag(self);
}
}
}
- sound (other, CHAN_AUTO, self.noise2, VOL_BASE, ATTN_NONE);
+ sound (other, CH_TRIGGER, self.noise2, VOL_BASE, ATTN_NONE);
WaypointSprite_DetachCarrier(other);
if(self.speedrunning)
FakeTimeLimit(other, -1);
self.dropperid = other.playerid;
PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
LogCTF("steal", self.team, other);
- sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NONE);
FOR_EACH_PLAYER(player)
if(player.team == self.team)
}
PlayerScore_Add(other, SP_CTF_RETURNS, 1);
LogCTF("return", self.team, other);
- sound (other, CHAN_AUTO, self.noise1, VOL_BASE, ATTN_NONE);
+ sound (other, CH_TRIGGER, self.noise1, VOL_BASE, ATTN_NONE);
ReturnFlag(self);
}
else if (!other.flagcarried && (other.playerid != self.dropperid || time > self.ctf_droptime + autocvar_g_balance_ctf_delay_collect))
UpdateFrags(other, f);
PlayerScore_Add(other, SP_CTF_PICKUPS, 1);
LogCTF("pickup", self.team, other);
- sound (other, CHAN_AUTO, self.noise, VOL_BASE, ATTN_NONE);
+ sound (other, CH_TRIGGER, self.noise, VOL_BASE, ATTN_NONE);
FOR_EACH_PLAYER(player)
if(player.team == self.team)
(default ctf/respawn.wav)
*/
+void spawnfunc_item_flag_team2();
void spawnfunc_item_flag_team1()
{
if (!g_ctf)
return;
}
+ if (g_ctf_reverse)
+ {
+ float old_g_ctf_reverse = g_ctf_reverse;
+ g_ctf_reverse = 0; // avoid an endless loop
+ spawnfunc_item_flag_team2();
+ g_ctf_reverse = old_g_ctf_reverse;
+ return;
+ }
+
// link flag into ctf_worldflaglist
self.ctf_worldflagnext = ctf_worldflaglist;
ctf_worldflaglist = self;
self.classname = "item_flag_team";
- if(g_ctf_reverse)
- {
- self.team = COLOR_TEAM2; // color 13 team (blue)
- self.items = IT_KEY1; // silver key (bluish enough)
- }
- else
- {
- self.team = COLOR_TEAM1; // color 4 team (red)
- self.items = IT_KEY2; // gold key (redish enough)
- }
+ self.team = COLOR_TEAM1; // color 4 team (red)
+ self.items = IT_KEY2; // gold key (redish enough)
self.netname = "^1RED^7 flag";
self.target = "###item###";
self.skin = autocvar_g_ctf_flag_red_skin;
return;
}
+ if (g_ctf_reverse)
+ {
+ float old_g_ctf_reverse = g_ctf_reverse;
+ g_ctf_reverse = 0; // avoid an endless loop
+ spawnfunc_item_flag_team1();
+ g_ctf_reverse = old_g_ctf_reverse;
+ return;
+ }
+
// link flag into ctf_worldflaglist
self.ctf_worldflagnext = ctf_worldflaglist;
ctf_worldflaglist = self;
self.classname = "item_flag_team";
- if(g_ctf_reverse)
- {
- self.team = COLOR_TEAM1; // color 4 team (red)
- self.items = IT_KEY2; // gold key (redish enough)
- }
- else
- {
- self.team = COLOR_TEAM2; // color 13 team (blue)
- self.items = IT_KEY1; // silver key (bluish enough)
- }
+ self.team = COLOR_TEAM2; // color 13 team (blue)
+ self.items = IT_KEY1; // silver key (bluish enough)
self.netname = "^4BLUE^7 flag";
self.target = "###item###";
self.skin = autocvar_g_ctf_flag_blue_skin;