set g_ctf_flag_return 1 "auto return the flag to base when touched by a teammate"
set g_ctf_flag_return_carrying 0 "(manual return mode) auto return the flag to base if touched by a flag carrier"
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 30 "automatically return the flag to base after this amount of time"
+set g_ctf_flag_return_time 30 "automatically return the flag to base after this amount of time; set it to 0 to disable this feature"
set g_ctf_flag_return_dropped 100 "automatically return the flag to base if dropped within this distance from base (in qu)"
set g_ctf_flag_return_damage 0 "allow the flag to be damaged when dropped, reducing time needed to automatically return to base; initial health is defined by g_ctf_flag_health"
set g_ctf_flag_return_damage_delay 0 "how much time the flag takes to automatically return to base if it falls into lava/slime/trigger hurt"
wp.colormod = WPCOLOR_DROPPEDFLAG(flag.team);
}
- if(autocvar_g_ctf_flag_return_time || (autocvar_g_ctf_flag_return_damage && autocvar_g_ctf_flag_health))
+ if(autocvar_g_ctf_flag_return_time > 0 || autocvar_g_ctf_flag_return_damage)
{
WaypointSprite_UpdateMaxHealth(flag.wps_flagdropped, flag.max_health);
WaypointSprite_UpdateHealth(flag.wps_flagdropped, GetResource(flag, RES_HEALTH));
case PICKUP_DROPPED:
{
- pickup_dropped_score = (autocvar_g_ctf_flag_return_time ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_return_time) - time) / autocvar_g_ctf_flag_return_time, 1) : 1);
+ pickup_dropped_score = (autocvar_g_ctf_flag_return_time > 0 ? bound(0, ((flag.ctf_droptime + autocvar_g_ctf_flag_return_time) - time) / autocvar_g_ctf_flag_return_time, 1) : 1);
pickup_dropped_score = floor((autocvar_g_ctf_score_pickup_dropped_late * (1 - pickup_dropped_score) + autocvar_g_ctf_score_pickup_dropped_early * pickup_dropped_score) + 0.5);
LOG_TRACE("pickup_dropped_score is ", ftos(pickup_dropped_score));
GameRules_scoring_add_team(player, SCORE, pickup_dropped_score);
if((flag.ctf_status == FLAG_DROPPED) || (flag.ctf_status == FLAG_PASSING))
{
if (flag.wps_flagdropped
- && (autocvar_g_ctf_flag_return_time || autocvar_g_ctf_flag_return_damage))
+ && (autocvar_g_ctf_flag_return_time > 0 || autocvar_g_ctf_flag_return_damage))
{
WaypointSprite_UpdateHealth(flag.wps_flagdropped, GetResource(flag, RES_HEALTH));
}
- if((GetResource(flag, RES_HEALTH) <= 0) || (time >= flag.ctf_droptime + autocvar_g_ctf_flag_return_time))
+ if((GetResource(flag, RES_HEALTH) <= 0)
+ || (autocvar_g_ctf_flag_return_time > 0 && time >= flag.ctf_droptime + autocvar_g_ctf_flag_return_time))
{
switch(returntype)
{
ctf_CheckFlagReturn(this, RETURN_NEEDKILL);
return;
}
- else if(autocvar_g_ctf_flag_return_time)
+ else if(autocvar_g_ctf_flag_return_time > 0)
{
TakeResource(this, RES_HEALTH, (this.max_health / autocvar_g_ctf_flag_return_time) * FLAG_THINKRATE);
ctf_CheckFlagReturn(this, RETURN_TIMEOUT);