]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
oh right, we HAVE destructors
authorRudolf Polzer <divverent@xonotic.org>
Sat, 14 May 2011 18:12:08 +0000 (20:12 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Sat, 14 May 2011 18:12:26 +0000 (20:12 +0200)
qcsrc/client/Main.qc
qcsrc/client/miscfunctions.qc

index f03c2b33d0bd8f87d0a3fbe8708bd124764039db..c2d0348c16e1a7ddf159a62c58cc0cb4cc0fc44c 100644 (file)
@@ -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();
 }
index c3f7d6bda9c3a33ae81ea6e44962c800fbc2f270..d59c75ba8d81629cfc485bea7499a6fe32a9a60a 100644 (file)
@@ -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;
 }