From: terencehill Date: Wed, 19 Jun 2019 09:21:10 +0000 (+0200) Subject: trigger_push_get_push_time: fix temporary entity not removed X-Git-Tag: xonotic-v0.8.5~1356^2~36 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8ed821e1e5c6eb9c71b9a49148fd5f6dbb29d89f;p=xonotic%2Fxonotic-data.pk3dir.git trigger_push_get_push_time: fix temporary entity not removed --- diff --git a/qcsrc/common/mapobjects/trigger/jumppads.qc b/qcsrc/common/mapobjects/trigger/jumppads.qc index 30cbc43364..f438fbf01f 100644 --- a/qcsrc/common/mapobjects/trigger/jumppads.qc +++ b/qcsrc/common/mapobjects/trigger/jumppads.qc @@ -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 != "")) diff --git a/qcsrc/server/bot/default/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc index 6c29f7bf17..d8f7e70a09 100644 --- a/qcsrc/server/bot/default/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -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; }