// capture the flag
// ==================
set g_ctf 0 "Capture The Flag: take the enemy flag and bring it to yours at your base to score"
+set g_ctf_oneflag 1 "Allow oneflag CTF mode on maps that support it"
set g_ctf_flag_return 1 "auto return the flag to base when touched by a teammate"
set g_ctf_flag_return_carried_radius 100 "allow flags to be returned by carrier if base is within this radius"
set g_ctf_flag_return_time 15
break;
}
+ nades_GiveBonus(player, autocvar_g_nades_bonus_score_high );
+
player.throw_prevtime = time;
player.throw_count = 0;
- nades_GiveBonus(player, autocvar_g_nades_bonus_score_high );
-
// messages and sounds
Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((enemy_flag.team) ? APP_TEAM_ENT_4(enemy_flag, CENTER_CTF_CAPTURE_) : CENTER_CTF_CAPTURE_NEUTRAL));
ctf_CaptureRecord(enemy_flag, player);
{
if(gameover) { return; }
if(self.active != ACTIVE_ACTIVE) { return; }
+ if(trace_dphitcontents & (DPCONTENTS_PLAYERCLIP | DPCONTENTS_MONSTERCLIP)) { return; }
entity toucher = other, tmp_entity;
float is_not_monster = (!(toucher.flags & FL_MONSTER)), num_perteam = 0;
void ctf_Use()
{
if(self.ctf_status != FLAG_BASE) { return; }
-
- entity flag;
- float flag_cnt = 0;
-
- for(flag = ctf_worldflaglist; flag; flag = flag.ctf_worldflagnext)
- {
- if(flag != self)
- if(SAME_TEAM(flag, self))
- if(flag.active == ACTIVE_ACTIVE)
- ++flag_cnt;
- }
-
- if(self.active == ACTIVE_ACTIVE)
- if(flag_cnt < 1)
- {
- dprint("ctf_Use: Unable to deactivate flag (not enough active flags on the map)\n");
- return;
- }
self.active = ((self.active) ? ACTIVE_NOT : ACTIVE_ACTIVE);
-
+
if(self.active == ACTIVE_ACTIVE)
WaypointSprite_Ping(self.wps_flagbase);
}
flag.event_damage = ctf_FlagDamage;
flag.pushable = TRUE;
flag.teleportable = TELEPORT_NORMAL;
+ flag.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
flag.damagedbytriggers = autocvar_g_ctf_flag_return_when_unreachable;
flag.damagedbycontents = autocvar_g_ctf_flag_return_when_unreachable;
flag.velocity = '0 0 0';
void spawnfunc_item_flag_neutral()
{
if(!g_ctf) { remove(self); return; }
+ if(!cvar("g_ctf_oneflag")) { remove(self); return; }
ctf_FlagSetup(0, self);
}