=============
*/
.float idlekick_lasttimeleft;
+.entity showheadshotbbox;
+void showheadshotbbox_think()
+{
+ if(self.owner.showheadshotbbox != self)
+ {
+ remove(self);
+ return;
+ }
+ self.nextthink = time;
+ setorigin(self, self.owner.origin);
+ setsize(self, GetHeadshotMins(self.owner), GetHeadshotMaxs(self.owner));
+}
void PlayerPostThink (void)
{
// Savage: Check for nameless players
if(self.waypointsprite_attachedforcarrier)
WaypointSprite_UpdateHealth(self.waypointsprite_attachedforcarrier, '1 0 0' * healtharmor_maxdamage(self.health, self.armorvalue, cvar("g_balance_armor_blockpercent")));
+ if(self.classname == "player" && self.deadflag == DEAD_NO && cvar("r_showbboxes"))
+ {
+ if(!self.showheadshotbbox)
+ {
+ self.showheadshotbbox = spawn();
+ self.showheadshotbbox.classname = "headshotbbox";
+ self.showheadshotbbox.owner = self;
+ self.showheadshotbbox.think = showheadshotbbox_think;
+ self.showheadshotbbox.nextthink = time;
+ self = self.showheadshotbbox;
+ self.think();
+ self = self.owner;
+ }
+ }
+ else
+ {
+ if(self.showheadshotbbox)
+ remove(self.showheadshotbbox);
+ }
+
playerdemo_write();
/*
return 1;
}
+vector GetHeadshotMins(entity targ)
+{
+ return '0.6 0 0' * targ.mins_x + '0 0.6 0' * targ.mins_y + '0 0 1' * (1.3 * targ.view_ofs_z - 0.3 * targ.maxs_z);
+}
+vector GetHeadshotMaxs(entity targ)
+{
+ return '0.6 0 0' * targ.maxs_x + '0 0.6 0' * targ.maxs_y + '0 0 1' * targ.maxs_z;
+}
+
void UpdateFrags(entity player, float f)
{
PlayerTeamScore_AddScore(player, f);
// if above view_ofs and below maxs, and also in the middle half of the bbox, it is head shot
vector headmins, headmaxs, org;
org = antilag_takebackorigin(targ, time - ANTILAG_LATENCY(attacker));
- headmins = org + '0.6 0 0' * targ.mins_x + '0 0.6 0' * targ.mins_y + '0 0 1' * (1.3 * targ.view_ofs_z - 0.3 * targ.maxs_z);
- headmaxs = org + '0.6 0 0' * targ.maxs_x + '0 0.6 0' * targ.maxs_y + '0 0 1' * targ.maxs_z;
+ headmins = org + GetHeadshotMins(targ);
+ headmaxs = org + GetHeadshotMaxs(targ);
if(trace_hits_box(railgun_start, railgun_end, headmins, headmaxs))
{
deathtype |= HITTYPE_HEADSHOT;