mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r15354) -Fix (r14803): first shared of a vehicle could be NULL making it impossible to (share-)clone the vehicle.
This commit is contained in:
parent
324b54132c
commit
b7c7a1f701
|
@ -1427,9 +1427,8 @@ void CheckOrders(const Vehicle *v)
|
||||||
/* Do we only have 1 station in our order list? */
|
/* Do we only have 1 station in our order list? */
|
||||||
if (n_st < 2 && problem_type == -1) problem_type = 0;
|
if (n_st < 2 && problem_type == -1) problem_type = 0;
|
||||||
|
|
||||||
assert(v->orders.list); // otherwise the check for v->FirstShared() != v would have been true
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
v->orders.list->DebugCheckSanity();
|
if (v->orders.list != NULL) v->orders.list->DebugCheckSanity();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* We don't have a problem */
|
/* We don't have a problem */
|
||||||
|
|
|
@ -515,7 +515,7 @@ public:
|
||||||
* Get the first vehicle of this vehicle chain.
|
* Get the first vehicle of this vehicle chain.
|
||||||
* @return the first vehicle of the chain.
|
* @return the first vehicle of the chain.
|
||||||
*/
|
*/
|
||||||
inline Vehicle *FirstShared() const { return (this->orders.list == NULL) ? NULL : this->orders.list->GetFirstSharedVehicle(); }
|
inline Vehicle *FirstShared() const { return (this->orders.list == NULL) ? this->First() : this->orders.list->GetFirstSharedVehicle(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we share our orders with another vehicle.
|
* Check if we share our orders with another vehicle.
|
||||||
|
|
Loading…
Reference in New Issue