From d94ce26392b4f398105a9b9e77748591986adfd4 Mon Sep 17 00:00:00 2001 From: cypress Date: Sun, 14 Apr 2024 22:02:06 -0700 Subject: [PATCH] SERVER: Insta-Kill always gibs Zombie head --- source/server/ai/zombie_core.qc | 19 +++++++++++++++++++ source/server/weapons/weapon_core.qc | 9 +-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/source/server/ai/zombie_core.qc b/source/server/ai/zombie_core.qc index a807c49..95a18b8 100644 --- a/source/server/ai/zombie_core.qc +++ b/source/server/ai/zombie_core.qc @@ -1126,6 +1126,25 @@ void(entity ent) Zombie_Death_Cleanup = { if(ent.aistatus == "0") { return; } + + // Insta-Kill should always cause the head to gib on Zombie death. + if (ent.head && instakill_finished > time) { + makevectors(ent.head.owner.angles); + vector where = ent.origin + (ent.head.view_ofs_x * v_right) + (ent.head.view_ofs_y * v_forward) + (ent.head.view_ofs_z * v_up); + spawn_gibs(where); + ent.head.deadflag = false; + ent.head.solid = SOLID_NOT; + setmodel(ent.head, ""); + ent.head.frame = 0; + +#ifndef FTE + + updateLimb (ent, 0, world); + +#endif // FTE + + } + ent.aistatus = "0"; ent.solid = SOLID_NOT; ent.movetype = MOVETYPE_NONE; diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index 9f04189..7c8b4e5 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -649,7 +649,7 @@ void Parse_Damage () = // DO NOT TOUCH // now. -- cypress (5 nov 2023) if (Zombie_HeadCanGib(body_ent, self.weapon)) { makevectors(body_ent.head.owner.angles); - vector where = body_ent.head.owner.origin + (body_ent.head.view_ofs_x * v_right) + (body_ent.head.view_ofs_y * v_forward) + (body_ent.head.view_ofs_z * v_up); + vector where = body_ent.origin + (body_ent.head.view_ofs_x * v_right) + (body_ent.head.view_ofs_y * v_forward) + (body_ent.head.view_ofs_z * v_up); spawn_gibs(where); body_ent.head.deadflag = false; @@ -1199,13 +1199,6 @@ void() WeaponCore_Melee = if (trace_ent.owner.head == trace_ent || trace_ent.owner.larm == trace_ent || trace_ent.owner.rarm == trace_ent) trace_ent = trace_ent.owner; - // Additionally, if the Zombie has a head and Insta-Kill is active, - // remove its head. - if (trace_ent.head) { - spawn_gibs(trace_ent.head.origin); - setmodel(trace_ent.head, ""); - } - // Play a flesh-y impact sound, spawn blood. sound (self, CHAN_WEAPON, "sounds/weapons/knife/knife_hitbod.wav", 1, ATTN_NORM); SpawnBlood(trace_source + (v_forward * 20), trace_source + (v_forward * 20), 50);