X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Fconveyor.qc;h=4214a73239628f1a06a405cda73f7d094a18e4cd;hb=375c41912c7afebd2f25e37920efef219489761f;hp=acb6529ff3c196a1853b3213f500b47e29eb5c54;hpb=6d4c6c37741b30553230ca5a27e6ebb8c6b885ac;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/func/conveyor.qc b/qcsrc/common/triggers/func/conveyor.qc index acb6529ff..4214a7323 100644 --- a/qcsrc/common/triggers/func/conveyor.qc +++ b/qcsrc/common/triggers/func/conveyor.qc @@ -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);