From: Rudolf Polzer Date: Wed, 25 Feb 2015 15:04:54 +0000 (+0100) Subject: Stop using model "" in func_breakable - it's unreliable when effects is X-Git-Tag: xonotic-v0.8.1~108 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6786000042cecf11261eb0263e43b170336a58c8;p=xonotic%2Fxonotic-data.pk3dir.git Stop using model "" in func_breakable - it's unreliable when effects is set. Rather use EF_NODRAW to prevent sending. --- diff --git a/qcsrc/server/func_breakable.qc b/qcsrc/server/func_breakable.qc index da0beaecb..be6104f1f 100644 --- a/qcsrc/server/func_breakable.qc +++ b/qcsrc/server/func_breakable.qc @@ -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; }