X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fcasings.qc;h=a43d1726fcdce42a09aa30356391dc25cca57ac1;hb=f72632a078a35c47c6771d1758d1c4093820b994;hp=1e2d4fbd8c92a3e1cec90f6710e16ba9a1cb2b15;hpb=a7b24450e4c7ca75636df1375d01d2266bd00c8c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/casings.qc b/qcsrc/client/casings.qc index 1e2d4fbd8..a43d1726f 100644 --- a/qcsrc/client/casings.qc +++ b/qcsrc/client/casings.qc @@ -15,6 +15,8 @@ void Casing_Draw() } Movetype_Physics_MatchTicrate(autocvar_cl_casings_ticrate, autocvar_cl_casings_sloppy); + if(wasfreed(self)) + return; // deleted by touch function self.renderflags = 0; self.alpha = bound(0, self.cnt - time, 1); @@ -75,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); @@ -113,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()