From 8ed821e1e5c6eb9c71b9a49148fd5f6dbb29d89f Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 19 Jun 2019 11:21:10 +0200 Subject: [PATCH] trigger_push_get_push_time: fix temporary entity not removed --- qcsrc/common/mapobjects/trigger/jumppads.qc | 9 ++++----- qcsrc/server/bot/default/waypoints.qc | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) 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; } -- 2.39.2