if (flatdist <= 0)
break;
+ if (stepdist > flatdist)
+ stepdist = flatdist;
if(nav_action == NAV_SWIM_UNDERWATER || (nav_action == NAV_SWIM_ONWATER && org.z > end2.z))
{
// can't use movement direction here to calculate move because of
//water_dir = normalize(water_end - org);
//move = org + water_dir * stepdist;
fixed_end.z = bound(end.z, org.z, end2.z);
- if (stepdist > flatdist)
- stepdist = flatdist;
if (stepdist == flatdist) {
move = fixed_end;
flatdist = 0;
}
else // horiz. direction
{
- if (stepdist > flatdist)
- stepdist = flatdist;
flatdist -= stepdist;
move = org + flatdir * stepdist;
}
nav_action = NAV_SWIM_ONWATER;
// we didn't advance horiz. in this step, flatdist decrease should be reverted
- // but we can do it properly right now... apply this workaround instead
+ // but we can't do it properly right now... apply this workaround instead
if (flatdist <= 0)
flatdist = 1;