From: Mario Date: Wed, 20 Jun 2018 09:30:45 +0000 (+1000) Subject: Avoid a goto by splitting the end of sys_phys_update into a postupdate function X-Git-Tag: xonotic-v0.8.5~1997 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=f594351cb824b34a7f6749522f4dcf4ac241ff71;p=xonotic%2Fxonotic-data.pk3dir.git Avoid a goto by splitting the end of sys_phys_update into a postupdate function --- 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; }