Changeset - r12903:0aae2e2e9a92
[Not reviewed]
master
0 3 0
yexo - 15 years ago 2009-09-03 12:11:31
yexo@openttd.org
(svn r17405) -Fix (r100): aircraft shouldn't be allowed to make turns bigger then 45 degrees while in flight
3 files changed with 14 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/aircraft.h
Show inline comments
 
@@ -91,6 +91,7 @@ struct Aircraft : public SpecializedVehi
 
	byte previous_pos;
 
	StationID targetairport;
 
	byte state;
 
	DirectionByte last_direction;
 

	
 
	/** We don't want GCC to zero our struct! It already is zeroed and has an index! */
 
	Aircraft() : SpecializedVehicle<Aircraft, VEH_AIRCRAFT>() {}
src/aircraft_cmd.cpp
Show inline comments
 
@@ -1048,6 +1048,8 @@ static bool AircraftController(Aircraft 
 
	count = UpdateAircraftSpeed(v, speed_limit, hard_limit);
 
	if (count == 0) return false;
 

	
 
	if (v->load_unload_time_rem != 0) v->load_unload_time_rem--;
 

	
 
	do {
 

	
 
		GetNewVehiclePosResult gp;
 
@@ -1069,9 +1071,15 @@ static bool AircraftController(Aircraft 
 
			/* Turn. Do it slowly if in the air. */
 
			Direction newdir = GetDirectionTowards(v, x + amd->x, y + amd->y);
 
			if (newdir != v->direction) {
 
				v->direction = newdir;
 
				if (!(amd->flag & AMED_SLOWTURN)) {
 
				if (amd->flag & AMED_SLOWTURN) {
 
					if (v->load_unload_time_rem == 0 || newdir == v->last_direction) {
 
						v->load_unload_time_rem = 8;
 
						v->last_direction = v->direction;
 
						v->direction = newdir;
 
					}
 
				} else {
 
					v->cur_speed >>= 1;
 
					v->direction = newdir;
 
				}
 
			}
 

	
src/saveload/vehicle_sl.cpp
Show inline comments
 
@@ -591,9 +591,10 @@ const SaveLoad *GetVehicleDescription(Ve
 
		     SLE_VAR(Aircraft, state,                 SLE_UINT8),
 

	
 
		 SLE_CONDVAR(Aircraft, previous_pos,          SLE_UINT8,                    2, SL_MAX_VERSION),
 
		 SLE_CONDVAR(Aircraft, last_direction,        SLE_UINT8,                    2, SL_MAX_VERSION),
 

	
 
		/* reserve extra space in savegame here. (currently 15 bytes) */
 
		SLE_CONDNULL(15,                                                           2, SL_MAX_VERSION),
 
		/* reserve extra space in savegame here. (currently 14 bytes) */
 
		SLE_CONDNULL(14,                                                           2, SL_MAX_VERSION),
 

	
 
		     SLE_END()
 
	};
0 comments (0 inline, 0 general)