From 60458b1f58c66a536c71df5b8b56606da42553ed Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sun, 26 Feb 2012 16:07:15 +0100 Subject: [PATCH] fix message spam for cl_casings 0 due to bad call to Casing_Delete --- qcsrc/client/casings.qc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/qcsrc/client/casings.qc b/qcsrc/client/casings.qc index d4d1041c8..a43d1726f 100644 --- a/qcsrc/client/casings.qc +++ b/qcsrc/client/casings.qc @@ -77,7 +77,7 @@ void Ent_Casing(float isNew) { entity casing; - casing = RubbleNew("casing"); + casing = RubbleNew("casing"); casing.state = ReadByte(); casing.silent = (casing.state & 0x80); casing.state = (casing.state & 0x7F); @@ -115,11 +115,16 @@ void Ent_Casing(float isNew) } setsize(casing, '0 0 -1', '0 0 -1'); - } - else - Casing_Delete(); - RubbleLimit("casing", autocvar_cl_casings_maxcount, Casing_Delete); + RubbleLimit("casing", autocvar_cl_casings_maxcount, Casing_Delete); + } + else + { + entity oldself = self; + self = casing; + Casing_Delete(); // yes, this IS stupid, but I don't need to duplicate all the read* stuff then + self = oldself; + } } void Casings_Precache() -- 2.39.2