]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make sure conveyor isn't added to the drawables list multiple times
authorMario <mario@smbclan.net>
Mon, 20 Feb 2017 13:42:57 +0000 (23:42 +1000)
committerMario <mario@smbclan.net>
Mon, 20 Feb 2017 13:42:57 +0000 (23:42 +1000)
qcsrc/common/triggers/func/conveyor.qc

index 90328da23002dd61a1a8cc37fb9b6c93705fb7d9..edd8eb9a27fc5a034f1766e49f6f9f9b05b6024d 100644 (file)
@@ -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)