mirror of https://github.com/OpenTTD/OpenTTD
(svn r7670) -Backport from trunk (r7558, r7559):
- [FS#464] do not wait till a crashed vehicle is removed before starting to load other vehicles (r7558). - [FS#456] clicking 'full load' can change depot order under certain circumstances (r7559).release/0.5
parent
953fc9e196
commit
6c8f12de78
|
@ -1272,7 +1272,7 @@ static bool LoadWait(const Vehicle* v, const Vehicle* u)
|
||||||
FOR_ALL_VEHICLES(x) {
|
FOR_ALL_VEHICLES(x) {
|
||||||
if ((x->type != VEH_Train || IsFrontEngine(x)) && // for all locs
|
if ((x->type != VEH_Train || IsFrontEngine(x)) && // for all locs
|
||||||
u->last_station_visited == x->last_station_visited && // at the same station
|
u->last_station_visited == x->last_station_visited && // at the same station
|
||||||
!(x->vehstatus & VS_STOPPED) && // not stopped
|
!(x->vehstatus & (VS_STOPPED | VS_CRASHED)) && // not stopped or crashed
|
||||||
x->current_order.type == OT_LOADING && // loading
|
x->current_order.type == OT_LOADING && // loading
|
||||||
u != x) { // not itself
|
u != x) { // not itself
|
||||||
bool other_has_any_cargo = false;
|
bool other_has_any_cargo = false;
|
||||||
|
|
11
order_cmd.c
11
order_cmd.c
|
@ -611,8 +611,17 @@ int32 CmdModifyOrder(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
|
||||||
u = GetFirstVehicleFromSharedList(v);
|
u = GetFirstVehicleFromSharedList(v);
|
||||||
DeleteOrderWarnings(u);
|
DeleteOrderWarnings(u);
|
||||||
for (; u != NULL; u = u->next_shared) {
|
for (; u != NULL; u = u->next_shared) {
|
||||||
/* toggle u->current_order "Full load" flag if it changed */
|
/* Toggle u->current_order "Full load" flag if it changed.
|
||||||
|
* However, as the same flag is used for depot orders, check
|
||||||
|
* whether we are not going to a depot as there are three
|
||||||
|
* cases where the full load flag can be active and only
|
||||||
|
* one case where the flag is used for depot orders. In the
|
||||||
|
* other cases for the OrderType the flags are not used,
|
||||||
|
* so do not care and those orders should not be active
|
||||||
|
* when this function is called.
|
||||||
|
*/
|
||||||
if (sel_ord == u->cur_order_index &&
|
if (sel_ord == u->cur_order_index &&
|
||||||
|
u->current_order.type != OT_GOTO_DEPOT &&
|
||||||
HASBIT(u->current_order.flags, OFB_FULL_LOAD) != HASBIT(order->flags, OFB_FULL_LOAD)) {
|
HASBIT(u->current_order.flags, OFB_FULL_LOAD) != HASBIT(order->flags, OFB_FULL_LOAD)) {
|
||||||
TOGGLEBIT(u->current_order.flags, OFB_FULL_LOAD);
|
TOGGLEBIT(u->current_order.flags, OFB_FULL_LOAD);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue