diff options
author | yexo <yexo@openttd.org> | 2009-09-04 20:31:47 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-09-04 20:31:47 +0000 |
commit | e540385038efc5b06bc30939c42180e3b70e6398 (patch) | |
tree | ece16562b7022824fd01c13893283fceabc39c2e | |
parent | 27738c6638c5ebdc2aec373617ee75202e719e62 (diff) | |
download | openttd-e540385038efc5b06bc30939c42180e3b70e6398.tar.xz |
(svn r17415) -Change: make sure aircraft don't move while turning as long as they are on the ground. This prevents a lot of unnecesary turns when leaving terminals
-rw-r--r-- | src/aircraft_cmd.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/aircraft_cmd.cpp b/src/aircraft_cmd.cpp index 3baf66116..07e29315f 100644 --- a/src/aircraft_cmd.cpp +++ b/src/aircraft_cmd.cpp @@ -1077,14 +1077,26 @@ static bool AircraftController(Aircraft *v) v->last_direction = v->direction; v->direction = newdir; } + + /* Move vehicle. */ + gp = GetNewVehiclePos(v); } else { v->cur_speed >>= 1; v->direction = newdir; + + /* When leaving a terminal an aircraft often goes to a position + * directly in front of it. If it would move while turning it + * would need an two extra turns to end up at the correct position. + * To make it easier just disallow all moving while turning as + * long as an aircraft is on the ground. */ + gp.x = v->x_pos; + gp.y = v->y_pos; + gp.new_tile = gp.old_tile = v->tile; } + } else { + /* Move vehicle. */ + gp = GetNewVehiclePos(v); } - - /* Move vehicle. */ - gp = GetNewVehiclePos(v); } v->tile = gp.new_tile; |