From 6c7347874801aaced1cb034e6f4c9aed8847f9a1 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Mon, 4 Apr 2011 00:16:50 +0300 Subject: [PATCH] Fix another bug with dead bodies. Also set the .owner entity of dead bodies to the player, which should be useful for other possible features. --- qcsrc/server/cl_player.qc | 1 + qcsrc/server/g_violence.qc | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 58924ed77..468b6a0bb 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -148,6 +148,7 @@ void CopyBody(float keepvelocity) Violence_DamageEffect_Copy(oldself, self); + self.owner = oldself; self = oldself; } diff --git a/qcsrc/server/g_violence.qc b/qcsrc/server/g_violence.qc index cee0c28a6..82b521364 100644 --- a/qcsrc/server/g_violence.qc +++ b/qcsrc/server/g_violence.qc @@ -82,7 +82,13 @@ void Violence_DamageEffect(entity pl, float type) e.classname = "weapondamage"; e.cnt = type; e.state |= 8 * pl.species; // gib type, ranges from 0 to 15 - e.team = num_for_edict(pl); + + // if this is a dead body, send the num of its player + if(pl.classname == "body") + e.team = num_for_edict(pl.owner); + else + e.team = num_for_edict(pl); + setorigin(e, pl.origin); Net_LinkEntity(e, FALSE, 0.2, Violence_DamageEffect_SendEntity); -- 2.39.2