Changeset - r22456:1b00f2c0bc73
[Not reviewed]
master
0 1 0
frosch - 8 years ago 2016-10-16 14:56:33
frosch@openttd.org
(svn r27663) -Codechange: Deduplicate code when rotating crashed vehicles.
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -3521,14 +3521,14 @@ static void ChangeTrainDirRandomly(Train
 
		/* We don't need to twist around vehicles if they're not visible */
 
		if (!(v->vehstatus & VS_HIDDEN)) {
 
			v->direction = ChangeDir(v->direction, delta[GB(Random(), 0, 2)]);
 
			v->UpdateDeltaXY(v->direction);
 
			v->cur_image = v->GetImage(v->direction, EIT_ON_MAP);
 
			/* Refrain from updating the z position of the vehicle when on
 
			 * a bridge, because UpdateInclination() will put the vehicle under
 
			 * the bridge in that case */
 
			if (v->track != TRACK_BIT_WORMHOLE) {
 
				v->UpdatePosition();
 
				v->UpdateInclination(false, false);
 
				v->UpdateInclination(false, true);
 
			} else {
 
				v->UpdateViewport(false, true);
 
			}
 
		}
 
	} while ((v = v->Next()) != NULL);
0 comments (0 inline, 0 general)