Changeset - r17155:63089d30d676
[Not reviewed]
master
0 1 0
smatz - 13 years ago 2011-01-23 17:50:24
smatz@openttd.org
(svn r21903) -Codechange: warn only once for a train that has invalid length, not for each its wagon with invalid length
1 file changed with 7 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -104,6 +104,7 @@ static void RailVehicleLengthChanged(con
 
void CheckTrainsLengths()
 
{
 
	const Train *v;
 
	bool first = true;
 

	
 
	FOR_ALL_TRAINS(v) {
 
		if (v->First() == v && !(v->vehstatus & VS_CRASHED)) {
 
@@ -116,7 +117,12 @@ void CheckTrainsLengths()
 
						SetDParam(1, v->owner);
 
						ShowErrorMessage(STR_BROKEN_VEHICLE_LENGTH, INVALID_STRING_ID, WL_CRITICAL);
 

	
 
						if (!_networking) DoCommandP(0, PM_PAUSED_ERROR, 1, CMD_PAUSE);
 
						if (!_networking && first) {
 
							first = false;
 
							DoCommandP(0, PM_PAUSED_ERROR, 1, CMD_PAUSE);
 
						}
 
						/* Break so we warn only once for each train. */
 
						break;
 
					}
 
				}
 
			}
0 comments (0 inline, 0 general)