SERVER: Fix Parse_Damage running on Waffe'd Zombies

This commit is contained in:
Steam Deck User 2023-03-05 00:41:58 -05:00
parent 5da6fcf87e
commit 92a68870aa
2 changed files with 15 additions and 6 deletions

View file

@ -1298,7 +1298,7 @@ void() Zombie_Find_Tesla_Target =
if (zombs.classname == "ai_zombie" || zombs.classname == "ai_dog") {
break_loop = true;
zombs.owner = self.owner;
zombs.firer = self.firer;
// remove libs
if (zombs.head)
@ -1309,16 +1309,22 @@ void() Zombie_Find_Tesla_Target =
setmodel(zombs.rarm, "");
// add 50pts
addmoney(self.owner, 50, true);
addmoney(self.firer, 50, true);
// kill
self.owner.kills += 1;
self.firer.kills += 1;
// add to tesla count
zombs.teslacount = self.teslacount + 1;
// classname change
zombs.classname = "wunder";
zombs.head.classname = zombs.larm.classname =
zombs.rarm.classname = "wunder_limb";
// just to be extra careful
zombs.takedamage = zombs.head.takedamage =
zombs.larm.takedamage = zombs.rarm.takedamage = DAMAGE_NO;
org = self.origin + '0 0 13';
targetorg = zombs.origin + '0 0 13';

View file

@ -696,6 +696,9 @@ void Parse_Damage () = // DO NOT TOUCH
while (ent) {
if (ent.classname != "radio" && ent.classname != "explosive_barrel") {
if (ent.classname == "wunder" || ent.classname == "wunder_limb")
return;
if (ent.classname == "ai_zombie_head")
head_hit = 1;
@ -907,7 +910,7 @@ void(float damage, vector dir, vector org, vector plane, entity hit_ent, float s
vel = vel * 200;
if (hit_ent.takedamage) {
if (trace_fraction >= 1) {
if (trace_fraction >= 1 || hit_ent.classname == "wunder") {
return;
}
if(hit_ent.classname == "item_radio" || hit_ent.classname == "teddy_spawn")
@ -1129,7 +1132,7 @@ void(entity hit_ent) LightningHit =
hit_ent.classname = "wunder";
// own it!
hit_ent.owner = self;
hit_ent.firer = self;
// we're the start of a chain
hit_ent.teslacount = 1;
@ -1194,7 +1197,7 @@ void(vector p1, vector p2, entity from, float damage) LightningDamage =
// Fire lightning out of the gun
void() W_FireTesla =
{
local vector source;
vector source;
makevectors (self.v_angle);
source = self.origin + self.view_ofs;