From: Mario Date: Mon, 20 Feb 2017 13:42:57 +0000 (+1000) Subject: Make sure conveyor isn't added to the drawables list multiple times X-Git-Tag: xonotic-v0.8.2~193 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7db3ccbb2cd08e0acbdf9aced3d72ed2fd0dea0d;p=xonotic%2Fxonotic-data.pk3dir.git Make sure conveyor isn't added to the drawables list multiple times --- diff --git a/qcsrc/common/triggers/func/conveyor.qc b/qcsrc/common/triggers/func/conveyor.qc index 90328da23..edd8eb9a2 100644 --- a/qcsrc/common/triggers/func/conveyor.qc +++ b/qcsrc/common/triggers/func/conveyor.qc @@ -154,10 +154,11 @@ spawnfunc(func_conveyor) void conveyor_draw(entity this) { conveyor_think(this); } -void conveyor_init(entity this) +void conveyor_init(entity this, bool isnew) { + if(isnew) + IL_PUSH(g_drawables, this); this.draw = conveyor_draw; - IL_PUSH(g_drawables, this); this.drawmask = MASK_NORMAL; set_movetype(this, MOVETYPE_NONE); @@ -196,7 +197,7 @@ NET_HANDLE(ENT_CLIENT_CONVEYOR, bool isnew) this.targetname = strzone(ReadString()); this.target = strzone(ReadString()); - conveyor_init(this); + conveyor_init(this, isnew); } if(sf & 2)