]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
trigger_push_get_push_time: fix temporary entity not removed
authorterencehill <piuntn@gmail.com>
Wed, 19 Jun 2019 09:21:10 +0000 (11:21 +0200)
committerterencehill <piuntn@gmail.com>
Wed, 19 Jun 2019 09:21:10 +0000 (11:21 +0200)
qcsrc/common/mapobjects/trigger/jumppads.qc
qcsrc/server/bot/default/waypoints.qc

index 30cbc433642e9eadaac23f04eb454545c53985d0..f438fbf01f5f8295032f45aa8e76647825377b04 100644 (file)
@@ -352,18 +352,17 @@ float trigger_push_get_push_time(entity this, vector endpos)
 {
        vector org = trigger_push_get_start_point(this);
 
-       entity e = spawn();
-       setsize(e, PL_MIN_CONST, PL_MAX_CONST);
-       e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
        float grav = PHYS_GRAVITY(NULL);
-       if (e && PHYS_ENTGRAVITY(e))
-               grav *= PHYS_ENTGRAVITY(e);
 
        entity t = this.enemy;
        if (t)
        {
+               entity e = spawn();
+               setsize(e, PL_MIN_CONST, PL_MAX_CONST);
+               e.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_PLAYERCLIP | DPCONTENTS_BOTCLIP;
                vector v = trigger_push_calculatevelocity(org, t, this.height, e);
                vector v2 = trigger_push_calculatevelocity(endpos, t, this.height, e);
+               delete(e);
                return (v.z + v2.z) / grav;
        }
        else if (!(this.target && this.target != ""))
index 6c29f7bf177757a18393dae14334a2860defe104..d8f7e70a09346020c94eab16ed9d0b70a5e4d2c0 100644 (file)
@@ -461,7 +461,7 @@ void waypoint_spawn_fromeditor(entity pl, bool at_crosshair)
                if(!start_wp)
                {
                        // should not happen
-                       LOG_INFOF("Couldn't find custom jumppad waypoint at %v\n", start_org);
+                       LOG_INFOF("Couldn't find start waypoint at %v\n", start_org);
                        waypoint_clear_start_wp(pl);
                        return;
                }