void SUB_CalcMovePause(entity this)
{
+ if (!this.move_controller)
+ return;
this.move_controller.animstate_starttime += frametime;
this.move_controller.animstate_endtime += frametime;
}
}
else
{
- if (trigger_push_testorigin(e, t, this, org))
+ // optimization: if horizontal velocity is 0 then target is not good since the trajectory
+ // will definitely go back to the jumppad (horizontal velocity of best_vel can't be 0 anyway)
+ if ((e.velocity.x != 0 || e.velocity.y != 0)
+ && trigger_push_testorigin(e, t, this, org))
{
best_target = trace_endpos;
best_org = org;