vector othermid = (other.absmin + other.absmax) * 0.5;
Damage(other, self, self, 0, DEATH_HURTTRIGGER, mymid, normalize(othermid - mymid) * ctf_captureshield_force);
- Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED);
+ if(IS_REAL_CLIENT(other)) { Send_Notification(NOTIF_ONE, other, MSG_CENTER, CENTER_CTF_CAPTURESHIELD_SHIELDED); }
}
void ctf_CaptureShield_Spawn(entity flag)
flag.owner.flagcarried = flag;
// reset flag
- setattachment(flag, player, "");
- setorigin(flag, FLAG_CARRY_OFFSET);
+ if(player.vehicle)
+ {
+ setattachment(flag, player.vehicle, "");
+ setorigin(flag, VEHICLE_FLAG_OFFSET);
+ flag.scale = VEHICLE_FLAG_SCALE;
+ }
+ else
+ {
+ setattachment(flag, player, "");
+ setorigin(flag, FLAG_CARRY_OFFSET);
+ }
flag.movetype = MOVETYPE_NONE;
flag.takedamage = DAMAGE_NO;
flag.solid = SOLID_NOT;
// attach the flag to the player
flag.owner = player;
player.flagcarried = flag;
- setattachment(flag, player, "");
- setorigin(flag, FLAG_CARRY_OFFSET);
+ if(player.vehicle)
+ {
+ setattachment(flag, player.vehicle, "");
+ setorigin(flag, VEHICLE_FLAG_OFFSET);
+ flag.scale = VEHICLE_FLAG_SCALE;
+ }
+ else
+ {
+ setattachment(flag, player, "");
+ setorigin(flag, FLAG_CARRY_OFFSET);
+ }
// flag setup
flag.movetype = MOVETYPE_NONE;
if((self.pass_target == world)
|| (self.pass_target.deadflag != DEAD_NO)
+ || (self.pass_target.flagcarried)
|| (vlen(self.origin - targ_origin) > autocvar_g_ctf_pass_radius)
|| ((trace_fraction < 1) && (trace_ent != self.pass_target))
|| (time > self.ctf_droptime + autocvar_g_ctf_pass_timelimit))
void ctf_FlagTouch()
{
if(gameover) { return; }
+ if(trace_dphitcontents & (DPCONTENTS_PLAYERCLIP | DPCONTENTS_MONSTERCLIP)) { return; }
entity toucher = other;
float is_not_monster = (!(toucher.flags & FL_MONSTER));
ctf_FakeTimeLimit(flag.owner, -1);
}
+ if((flag.owner) && (flag.owner.vehicle))
+ flag.scale = FLAG_SCALE;
+
if((flag.ctf_status == FLAG_DROPPED) && (flag.wps_flagdropped))
{ WaypointSprite_Kill(flag.wps_flagdropped); }
flag.ctf_dropper = world;
flag.ctf_pickuptime = 0;
flag.ctf_droptime = 0;
+
+ ctf_CheckStalemate();
}
void ctf_Reset()
// if there is only me on the team switch to offense
c = 0;
FOR_EACH_PLAYER(head)
- if(head.team==bot.team)
+ if(SAME_TEAM(head, bot))
++c;
if(c==1)
}
if(closestplayer)
- if(closestplayer.team!=self.team)
+ if(DIFF_TEAM(closestplayer, self))
if(vlen(org - self.origin)>1000)
if(checkpvs(self.origin,closestplayer)||random()<0.5)
havocbot_goalrating_ctf_ourbase(30000);