]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/conveyor.qc
Merge branch 'DefaultUser/gametype_votescreen' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / conveyor.qc
index bdb80fe14366db3c0ab39a208d709f09a7ab4a83..90328da23002dd61a1a8cc37fb9b6c93705fb7d9 100644 (file)
@@ -1,3 +1,4 @@
+#include "conveyor.qh"
 REGISTER_NET_LINKED(ENT_CLIENT_CONVEYOR)
 
 void conveyor_think(entity this)
@@ -10,9 +11,10 @@ void conveyor_think(entity this)
 #endif
 
        // set mythis as current conveyor where possible
-       FOREACH_ENTITY_ENT(conveyor, this,
+       IL_EACH(g_conveyed, it.conveyor == this,
        {
                it.conveyor = NULL;
+               IL_REMOVE(g_conveyed, it);
        });
 
        if(this.state)
@@ -28,10 +30,14 @@ void conveyor_think(entity this)
                        }
                        if(boxesoverlap(emin, emax, this.absmin, this.absmax)) // quick
                                if(WarpZoneLib_BoxTouchesBrush(emin, emax, this, it)) // accurate
+                               {
+                                       if(!it.conveyor)
+                                               IL_PUSH(g_conveyed, it);
                                        it.conveyor = this;
+                               }
                });
 
-               FOREACH_ENTITY_ENT(conveyor, this,
+               IL_EACH(g_conveyed, it.conveyor == this,
                {
                        if(IS_CLIENT(it)) // doing it via velocity has quite some advantages
                                continue; // done in SV_PlayerPhysics   continue;
@@ -140,7 +146,7 @@ spawnfunc(func_conveyor)
 {
        SetMovedir(this);
        InitMovingBrushTrigger(this);
-       this.movetype = MOVETYPE_NONE;
+       set_movetype(this, MOVETYPE_NONE);
        conveyor_init(this);
 }
 
@@ -151,9 +157,10 @@ void conveyor_draw(entity this) { conveyor_think(this); }
 void conveyor_init(entity this)
 {
        this.draw = conveyor_draw;
+       IL_PUSH(g_drawables, this);
        this.drawmask = MASK_NORMAL;
 
-       this.movetype = MOVETYPE_NONE;
+       set_movetype(this, MOVETYPE_NONE);
        this.model = "";
        this.solid = SOLID_TRIGGER;
        this.move_time = time;