]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Stop using model "" in func_breakable - it's unreliable when effects is
authorRudolf Polzer <divverent@xonotic.org>
Wed, 25 Feb 2015 15:04:54 +0000 (16:04 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Wed, 25 Feb 2015 15:04:54 +0000 (16:04 +0100)
set.

Rather use EF_NODRAW to prevent sending.

qcsrc/server/func_breakable.qc

index da0beaecb336c253a2915c2cf99615418416cea9..be6104f1fa6d2c653cc6acb25bc3f818cab46840 100644 (file)
@@ -91,7 +91,7 @@ void func_breakable_look_destroyed()
                self.dropped_origin = self.origin;
 
        if(self.mdl_dead == "")
-               self.model = "";
+               self.effects |= EF_NODRAW;
        else {
                if (self.origin == '0 0 0')     {       // probably no origin brush, so don't spawn in the middle of the map..
                        floorZ = self.absmin.z;
@@ -99,16 +99,24 @@ void func_breakable_look_destroyed()
                        self.origin_z = floorZ;
                }
                setmodel(self, self.mdl_dead);
+               self.effects &= ~EF_NODRAW;
        }
 
+       CSQCMODEL_AUTOUPDATE();
+
        self.solid = SOLID_NOT;
 }
 
 void func_breakable_look_restore()
 {
        setmodel(self, self.mdl);
+       self.effects &= ~EF_NODRAW;
+
        if(self.mdl_dead != "") // only do this if we use mdl_dead, to behave better with misc_follow
                setorigin(self, self.dropped_origin);
+
+       CSQCMODEL_AUTOUPDATE();
+
        self.solid = SOLID_BSP;
 }