SERVER: Fix all undefined behaviors with shooting Tesla weapons at ents

This commit is contained in:
cypress 2024-01-06 18:27:44 -05:00
parent fedc19c05a
commit 4579bd7884
4 changed files with 5 additions and 14 deletions

View file

@ -459,11 +459,6 @@ void() Zombie_Think = //called every frame for zombies
self.th_die();
}
if (self.classname == "wunder") {
self.th_diewunder();
return;
}
if (self.bleedingtime < time && !self.head.deadflag)
{
self.bleedingtime = time + 1;
@ -953,7 +948,7 @@ void() zombie_attack =
if(self.state == 1) // If the zombie is in this state (rising, or something else) they shouldn't be able to attack!
return;
if (self.classname == "wunder" || self.electro_targeted == true)
if (self.electro_targeted == true)
return;
if(self.outside == TRUE)

View file

@ -114,7 +114,6 @@ void() item_radio =
self.health = 1;
self.radioState = 0;
self.th_die = radio_hit;
self.th_diewunder = SUB_Null;
};
/* ================

View file

@ -61,6 +61,9 @@ void(vector pos) tesla_spark = {
void(entity hit_ent, entity arc_parent, entity arc_owner, float arc_num, float do_arc) tesla_damage = {
// set lib models to null
// (if we remove them RelinkZombies will cry)
if (!hit_ent.th_diewunder)
return;
if (hit_ent.head)
setmodel(hit_ent.head, "");
if (hit_ent.larm)
@ -76,9 +79,6 @@ void(entity hit_ent, entity arc_parent, entity arc_owner, float arc_num, float d
self.state = self.hop_step = 0;
}
// // change classname so it can't be re-targted
// hit_ent.classname = "wunder";
if(arc_owner != world) {
arc_owner.tesla_n_kills += 1;

View file

@ -610,9 +610,6 @@ 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;
@ -803,7 +800,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 || hit_ent.classname == "wunder") {
if (trace_fraction >= 1) {
return;
}
if(hit_ent.classname == "item_radio" || hit_ent.classname == "teddy_spawn")