+void W_Hagar_Damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
+{
+ if (self.health <= 0)
+ return;
+
+ float is_linkexplode = ((inflictor.realowner == self.realowner)
+ && (inflictor.projectiledeathtype & HITTYPE_SECONDARY)
+ && (self.projectiledeathtype & HITTYPE_SECONDARY));
+
+ if(is_linkexplode)
+ is_linkexplode = (is_linkexplode && autocvar_g_balance_hagar_secondary_load_linkexplode);
+ else
+ is_linkexplode = -1; // not secondary load, so continue as normal without exception.
+
+ if (!W_CheckProjectileDamage(inflictor.realowner, self.realowner, deathtype, is_linkexplode))
+ return; // g_projectiles_damage says to halt
+
+ self.health = self.health - damage;
+ self.angles = vectoangles(self.velocity);
+
+ if (self.health <= 0)
+ W_PrepareExplosionByDamage(attacker, self.think);
+}
+