From 852b9503db3046f5e42e1dafb771c371e4c47d19 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 14 May 2011 20:12:08 +0200 Subject: [PATCH] oh right, we HAVE destructors --- qcsrc/client/Main.qc | 5 +++++ qcsrc/client/miscfunctions.qc | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index f03c2b33d..c2d0348c1 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -654,6 +654,10 @@ float CSQC_InputEvent(float bInputType, float nPrimary, float nSecondary) // -------------------------------------------------------------------------- // BEGIN OPTIONAL CSQC FUNCTIONS +void Ent_RemoveEntCS() +{ + entcs_receiver[self.sv_entnum] = world; +} void Ent_ReadEntCS() { InterpolateOrigin_Undo(); @@ -666,6 +670,7 @@ void Ent_ReadEntCS() self.angles_y = ReadByte() * 360.0 / 256; self.origin_z = self.angles_x = self.angles_z = 0; entcs_receiver[self.sv_entnum] = self; + self.entremove = Ent_RemoveEntCS; InterpolateOrigin_Note(); } diff --git a/qcsrc/client/miscfunctions.qc b/qcsrc/client/miscfunctions.qc index c3f7d6bda..d59c75ba8 100644 --- a/qcsrc/client/miscfunctions.qc +++ b/qcsrc/client/miscfunctions.qc @@ -766,9 +766,8 @@ vector getplayerorigin(float pl) return stov(s); e = entcs_receiver[pl]; - if(e.classname == "entcs_receiver") - if(e.sv_entnum == pl) - return e.origin; + if(e) + return e.origin; return GETPLAYERORIGIN_ERROR; } -- 2.39.2