Changeset - r23137:30ea4915fb74
[Not reviewed]
master
0 1 0
Joan Josep - 5 years ago 2019-01-12 17:04:04
juanjo.ng.83@gmail.com
Codechange #5859: Simplify CheckTrainStayInDepot() (#7045)
1 file changed with 3 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/train_cmd.cpp
Show inline comments
 
@@ -2149,12 +2149,10 @@ static bool CheckTrainStayInDepot(Train 
 
		seg_state = _settings_game.pf.reserve_paths ? SIGSEG_PBS : UpdateSignalsOnSegment(v->tile, INVALID_DIAGDIR, v->owner);
 
	}
 

	
 
	/* We are leaving a depot, but have to go to the exact same one; re-enter */
 
	/* We are leaving a depot, but have to go to the exact same one; re-enter. */
 
	if (v->current_order.IsType(OT_GOTO_DEPOT) && v->tile == v->dest_tile) {
 
		/* We need to have a reservation for this to work. */
 
		if (HasDepotReservation(v->tile)) return true;
 
		SetDepotReservation(v->tile, true);
 
		VehicleEnterDepot(v);
 
		/* Service when depot has no reservation. */
 
		if (!HasDepotReservation(v->tile)) VehicleEnterDepot(v);
 
		return true;
 
	}
 

	
0 comments (0 inline, 0 general)