]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/jumppads.qc
Fix bots waiting for a teamed item to spawn again once they got it (e.g. megas and...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / jumppads.qc
index edbe9c580a28ec33d50314236a3346f58feed121..df965074587315eebbc4781704aba2f7386410f9 100644 (file)
@@ -222,7 +222,7 @@ bool jumppad_push(entity this, entity targ)
        }
 
        if(this.enemy.target)
-               SUB_UseTargets(this.enemy, targ, targ); // TODO: do we need targ as trigger too?
+               SUB_UseTargets(this.enemy, targ, this);
 
        if (targ.flags & FL_PROJECTILE)
        {
@@ -277,7 +277,7 @@ void trigger_push_findtarget(entity this)
 {
        // first calculate a typical start point for the jump
        vector org = (this.absmin + this.absmax) * 0.5;
-       org_z = this.absmax.z - STAT(PL_MIN, NULL).z;
+       org.z = this.absmax.z - PL_MIN_CONST.z;
 
        if (this.target)
        {
@@ -288,7 +288,7 @@ void trigger_push_findtarget(entity this)
 #ifdef SVQC
                        entity e = spawn();
                        setorigin(e, org);
-                       setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
+                       setsize(e, PL_MIN_CONST, PL_MAX_CONST);
                        e.velocity = trigger_push_calculatevelocity(org, t, this.height);
                        tracetoss(e, e);
                        if(e.move_movetype == MOVETYPE_NONE)
@@ -321,7 +321,7 @@ void trigger_push_findtarget(entity this)
        {
                entity e = spawn();
                setorigin(e, org);
-               setsize(e, STAT(PL_MIN, NULL), STAT(PL_MAX, NULL));
+               setsize(e, PL_MIN_CONST, PL_MAX_CONST);
                e.velocity = this.movedir;
                tracetoss(e, e);
                waypoint_spawnforteleporter(this, trace_endpos, vlen(trace_endpos - org) / vlen(e.velocity));
@@ -418,6 +418,9 @@ bool target_push_send(entity this, entity to, float sf)
 
 void target_push_use(entity this, entity actor, entity trigger)
 {
+       if(trigger.classname == "trigger_push" || trigger == this)
+               return; // WTF, why is this a thing
+
        jumppad_push(this, actor);
 }
 
@@ -477,9 +480,9 @@ NET_HANDLE(ENT_CLIENT_TRIGGER_PUSH, bool isnew)
 
 void target_push_remove(entity this)
 {
-       if(this.classname)
-               strunzone(this.classname);
-       this.classname = string_null;
+       //if(this.classname)
+               //strunzone(this.classname);
+       //this.classname = string_null;
 
        if(this.targetname)
                strunzone(this.targetname);