]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/conveyor.qc
Explicitly check for ACTIVE_ACTIVE
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / conveyor.qc
index acb6529ff3c196a1853b3213f500b47e29eb5c54..4214a73239628f1a06a405cda73f7d094a18e4cd 100644 (file)
@@ -17,7 +17,7 @@ void conveyor_think(entity this)
                IL_REMOVE(g_conveyed, it);
        });
 
-       if(this.active)
+       if(this.active == ACTIVE_ACTIVE)
        {
                FOREACH_ENTITY_RADIUS((this.absmin + this.absmax) * 0.5, vlen(this.absmax - this.absmin) * 0.5 + 1, !it.conveyor.active && isPushable(it),
                {
@@ -63,54 +63,6 @@ void conveyor_think(entity this)
 
 #ifdef SVQC
 
-void conveyor_setactive(entity this, int act)
-{
-       int old_status = this.active;
-       if(act == ACTIVE_TOGGLE)
-       {
-               if(this.active == ACTIVE_ACTIVE)
-               {
-                       this.active = ACTIVE_NOT;
-               }
-               else
-               {
-                       this.active = ACTIVE_ACTIVE;
-               }
-       }
-       else
-       {
-               this.active = act;
-       }
-
-       if (this.active != old_status)
-       {
-               this.SendFlags |= SF_TRIGGER_UPDATE;
-       }
-}
-
-// Compatibility with old maps
-void conveyor_use(entity this, entity actor, entity trigger)
-{
-       conveyor_setactive(this, ACTIVE_TOGGLE);
-}
-
-void conveyor_reset(entity this)
-{
-       IFTARGETED
-       {
-               if(this.spawnflags & CONVEYOR_START_ENABLED)
-               {
-                       this.active = ACTIVE_ACTIVE;
-               }
-       }
-       else
-       {
-               this.active = ACTIVE_ACTIVE;
-       }
-
-       this.SendFlags |= SF_TRIGGER_UPDATE;
-}
-
 bool conveyor_send(entity this, entity to, int sendflags)
 {
        WriteHeader(MSG_ENTITY, ENT_CLIENT_CONVEYOR);
@@ -145,13 +97,13 @@ void conveyor_init(entity this)
        this.movedir *= this.speed;
        setthink(this, conveyor_think);
        this.nextthink = time;
-       this.setactive = conveyor_setactive;
+       this.setactive = generic_netlinked_setactive;
        IFTARGETED
        {
                // backwards compatibility
-               this.use = conveyor_use;
+               this.use = generic_netlinked_legacy_use;
        }
-       this.reset = conveyor_reset;
+       this.reset = generic_netlinked_reset;
        this.reset(this);
 
        FixSize(this);