From 1de949c4ea9fe731097ffda83a4b0eac58c0836f Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 5 Apr 2012 15:15:28 +0200 Subject: [PATCH] when "a CSQC entity changed its type", make sure ALL entity fields are cleared --- qcsrc/client/Main.qc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 12343e6a2..d4a8a38de 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -2,6 +2,19 @@ // BEGIN REQUIRED CSQC FUNCTIONS //include "main.qh" +.entity clearentity_ent; +void clearentity(entity e) +{ + if(!clearentity_ent) + { + clearentity_ent = spawn(); + clearentity_ent.classname = "clearentity"; + } + float n = e.entnum; + copyentity(clearentity_ent, e); + e.entnum = n; +} + #define DP_CSQC_ENTITY_REMOVE_IS_B0RKED void menu_show_error() { @@ -706,6 +719,7 @@ void CSQC_Ent_Update(float bIsNewEntity) //print(_("A CSQC entity changed its type!\n")); print(sprintf(_("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n"), num_for_edict(self), self.entnum, self.enttype, t)); Ent_Remove(); + clearentity(self); bIsNewEntity = 1; } } -- 2.39.2