@@ -38,6 +38,7 @@ local CMD_MOVE = CMD.MOVE
3838local CMD_REMOVE = CMD .REMOVE
3939local privateTable = {private = true }
4040local sightTable = {inlos = true }
41+ local DISARM_CANCEL_FACTOR = 2
4142
4243local spGetHeadingFromVector = Spring .GetHeadingFromVector
4344local spGetUnitPosition = Spring .GetUnitPosition
@@ -413,13 +414,18 @@ local function Jump(unitID, goal, origCmdParams, mustJump)
413414 end
414415
415416 if delay > 0 then
417+ local timeoutFrames = delay * DISARM_CANCEL_FACTOR
416418 while delay > 0 do
417419 local stunned = Spring .GetUnitIsStunned (unitID )
418420 if not stunned then
419- delay = delay - (GG .att_ReloadChange [unitID ] or 1 ) -- Disarm or slow
421+ local speedMult = (GG .att_ReloadChange [unitID ] or 1 ) -- Disarm or slow
422+ delay = delay - speedMult
423+ if speedMult == 0 then
424+ timeoutFrames = timeoutFrames - 1
425+ end
420426 end
421427 local attachedTransport = Spring .GetUnitTransporter (unitID )
422- if attachedTransport then
428+ if attachedTransport or timeoutFrames <= 0 then
423429 FinishJump (unitID )
424430 -- Transport cancels jump
425431 CallAsUnitIfExists (unitID , env .cancelJump )
@@ -433,7 +439,7 @@ local function Jump(unitID, goal, origCmdParams, mustJump)
433439 end
434440
435441 CallAsUnitIfExists (unitID ,env .beginJump )
436- if PLAY_SOUND and (not cannotJumpMidair ) then -- don't make sound if we jump with legs instead of jets
442+ if PLAY_SOUND and (not cannotJumpMidair ) then -- don't make sound if we jump with legs instead of jets
437443 GG .PlayFogHiddenSound (" Jump" , UnitDefs [unitDefID ].mass / 10 , start [1 ], start [2 ], start [3 ])
438444 end
439445 if rotateMidAir then
0 commit comments