From 6786000042cecf11261eb0263e43b170336a58c8 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 25 Feb 2015 16:04:54 +0100 Subject: [PATCH] Stop using model "" in func_breakable - it's unreliable when effects is set. Rather use EF_NODRAW to prevent sending. --- qcsrc/server/func_breakable.qc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; } -- 2.39.2