(svn r20079) -Codechange [FS#3922]: Add helper functions to deal with the 192-256-magic of vehicle movement.

This commit is contained in:
frosch
2010-07-04 13:07:47 +00:00
parent ed2213df23
commit a7d168b2e5
5 changed files with 68 additions and 27 deletions

View File

@@ -346,8 +346,8 @@ static bool ShipAccelerate(Vehicle *v)
SetWindowWidgetDirty(WC_VEHICLE_VIEW, v->index, VVW_WIDGET_START_STOP_VEH);
}
/* Decrease somewhat when turning */
if (!(v->direction & 1)) spd = spd * 3 / 4;
/* Convert direction-indepenent speed into direction-dependent speed. (old movement method) */
spd = v->GetOldAdvanceSpeed(spd);
if (spd == 0) return false;
if ((byte)++spd == 0) return true;