else if(CTF_DIFFTEAM(player, flag))
Send_Notification(NOTIF_ONE, player, MSG_CENTER, APP_TEAM_NUM(flag.team, CENTER_CTF_PICKUP));
else
- Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((SAME_TEAM(player, flag)) ? CENTER_CTF_PICKUP_TEAM : CENTER_CTF_PICKUP_TEAM_ENEMY), Team_ColorCode(flag.team));
+ Send_Notification(NOTIF_ONE, player, MSG_CENTER, ((SAME_TEAM(player, flag)) ? CENTER_CTF_PICKUP_RETURN : CENTER_CTF_PICKUP_RETURN_ENEMY), Team_ColorCode(flag.team));
Send_Notification(NOTIF_TEAM_EXCEPT, player, MSG_CHOICE, APP_NUM(flag.team, CHOICE_CTF_PICKUP_TEAM), Team_ColorCode(player.team), player.netname);
METHOD(Flag, giveTo, bool(Flag this, entity flag, entity toucher))
{
return = false;
- if(gameover) { return; }
+ if(game_stopped) return;
if(trace_dphitcontents & (DPCONTENTS_PLAYERCLIP | DPCONTENTS_MONSTERCLIP)) { return; }
bool is_not_monster = (!IS_MONSTER(toucher));
else if(is_not_monster && (!toucher.flagcarried))
ctf_Handle_Pickup(flag, toucher, PICKUP_DROPPED);
}
- else
+ else if(!toucher.flagcarried)
ctf_Handle_Retrieve(flag, toucher);
}
break;
entity f;
vector s = '0 0 0';
vector fo = '0 0 0';
- float n = 0;
+ int n = 0;
f = ctf_worldflaglist;
while (f)
fo = f.origin;
s = s + fo;
f = f.ctf_worldflagnext;
+ n++;
}
if(!n)
return;
- havocbot_ctf_middlepoint = s * (1.0 / n);
- havocbot_ctf_middlepoint_radius = vlen(fo - havocbot_ctf_middlepoint);
+ havocbot_ctf_middlepoint = s / n;
+ havocbot_ctf_middlepoint_radius = vlen(fo - havocbot_ctf_middlepoint);
}
WaypointSprite_UpdateHealth(player.wps_flagcarrier, '1 0 0' * healtharmor_maxdamage(player.health, player.armorvalue, autocvar_g_balance_armor_blockpercent, DEATH_WEAPON.m_id));
}
-MUTATOR_HOOKFUNCTION(ctf, PlayerDamage_Calculate) // for changing damage and force values that are applied to players in g_damage.qc
+MUTATOR_HOOKFUNCTION(ctf, Damage_Calculate) // for changing damage and force values that are applied to players in g_damage.qc
{
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
MUTATOR_HOOKFUNCTION(ctf, PlayerUseKey)
{
- if(MUTATOR_RETURNVALUE || gameover) { return; }
+ if(MUTATOR_RETURNVALUE || game_stopped) return;
entity player = M_ARGV(0, entity);
player.throw_antispam = time + autocvar_g_ctf_pass_wait;
return true;
}
- else if(player.flagcarried)
+ else if(player.flagcarried && !head.flagcarried)
{
if(closest_target)
{
spawnfunc(team_CTF_neutralflag) { spawnfunc_item_flag_neutral(this); }
spawnfunc(team_neutralobelisk) { spawnfunc_item_flag_neutral(this); }
+// compatibility for wop maps
+spawnfunc(team_redplayer) { spawnfunc_info_player_team1(this); }
+spawnfunc(team_blueplayer) { spawnfunc_info_player_team2(this); }
+spawnfunc(team_ctl_redlolly) { spawnfunc_item_flag_team1(this); }
+spawnfunc(team_CTL_redlolly) { spawnfunc_item_flag_team1(this); }
+spawnfunc(team_ctl_bluelolly) { spawnfunc_item_flag_team2(this); }
+spawnfunc(team_CTL_bluelolly) { spawnfunc_item_flag_team2(this); }
+
// ==============
// Initialization