From f594351cb824b34a7f6749522f4dcf4ac241ff71 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 20 Jun 2018 19:30:45 +1000 Subject: [PATCH] Avoid a goto by splitting the end of sys_phys_update into a postupdate function --- qcsrc/ecs/systems/physics.qc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc index 8896b5a44..ae5f119e7 100644 --- a/qcsrc/ecs/systems/physics.qc +++ b/qcsrc/ecs/systems/physics.qc @@ -6,6 +6,8 @@ void sys_phys_simulate(entity this, float dt); void sys_phys_simulate_simple(entity this, float dt); +void sys_phys_postupdate(entity this); + void sys_phys_update(entity this, float dt) { if (!IS_CLIENT(this)) { @@ -63,7 +65,8 @@ void sys_phys_update(entity this, float dt) // if(pointcontents(midpoint + '0 0 2') == CONTENT_WATER) // { this.velocity_z = 70; } } - goto end; + sys_phys_postupdate(this); + return; } PM_check_slick(this); @@ -153,7 +156,11 @@ void sys_phys_update(entity this, float dt) this.com_phys_air = false; } - LABEL(end) + sys_phys_postupdate(this); +} + +void sys_phys_postupdate(entity this) +{ if (IS_ONGROUND(this)) { this.lastground = time; } // conveyors: then break velocity again if (this.conveyor.active) { this.velocity += this.conveyor.movedir; } -- 2.39.2