src/train_cmd.cpp
changeset 9705 39330e3f52c2
parent 9704 54123af5f9a5
child 9738 404c804ac68a
equal deleted inserted replaced
9704:54123af5f9a5 9705:39330e3f52c2
   208 
   208 
   209 		SetDParam(1, u->engine_type);
   209 		SetDParam(1, u->engine_type);
   210 		GetString(buffer, STR_NEWGRF_BROKEN_VEHICLE_LENGTH, lastof(buffer));
   210 		GetString(buffer, STR_NEWGRF_BROKEN_VEHICLE_LENGTH, lastof(buffer));
   211 		DEBUG(grf, 0, "%s", buffer + 3);
   211 		DEBUG(grf, 0, "%s", buffer + 3);
   212 
   212 
   213 #ifdef ENABLE_NETWORK
       
   214 		if (!_networking) _pause_game = -1;
   213 		if (!_networking) _pause_game = -1;
   215 #else
       
   216 		_pause_game = -1;
       
   217 #endif
       
   218 	}
   214 	}
   219 }
   215 }
   220 
   216 
   221 /** Checks if lengths of all rail vehicles are valid. If not, shows an error message. */
   217 /** Checks if lengths of all rail vehicles are valid. If not, shows an error message. */
   222 void CheckTrainsLengths()
   218 void CheckTrainsLengths()
   231 							max(abs(u->x_pos - w->x_pos), abs(u->y_pos - w->y_pos)) != u->u.rail.cached_veh_length) ||
   227 							max(abs(u->x_pos - w->x_pos), abs(u->y_pos - w->y_pos)) != u->u.rail.cached_veh_length) ||
   232 							(w->u.rail.track == TRACK_BIT_DEPOT && TicksToLeaveDepot(u) <= 0)) {
   228 							(w->u.rail.track == TRACK_BIT_DEPOT && TicksToLeaveDepot(u) <= 0)) {
   233 						SetDParam(0, v->index);
   229 						SetDParam(0, v->index);
   234 						SetDParam(1, v->owner);
   230 						SetDParam(1, v->owner);
   235 						ShowErrorMessage(INVALID_STRING_ID, STR_BROKEN_VEHICLE_LENGTH, 0, 0);
   231 						ShowErrorMessage(INVALID_STRING_ID, STR_BROKEN_VEHICLE_LENGTH, 0, 0);
   236 #ifdef ENABLE_NETWORK
   232 
   237 						if (!_networking) _pause_game = -1;
   233 						if (!_networking) _pause_game = -1;
   238 #else
       
   239 						_pause_game = -1;
       
   240 #endif
       
   241 					}
   234 					}
   242 				}
   235 				}
   243 			}
   236 			}
   244 		}
   237 		}
   245 	}
   238 	}