Mercurial > hg > openttd
comparison src/vehicle.cpp @ 16944:b0c943e6f39f draft
(svn r21679) -Fix (r21642): reading a just freed variable
author | rubidium <rubidium@openttd.org> |
---|---|
date | Fri, 31 Dec 2010 15:53:46 +0000 |
parents | b5b35c9355a3 |
children | 9f83d76a6f12 |
comparison
equal
deleted
inserted
replaced
16943:e2c807283ac2 | 16944:b0c943e6f39f |
---|---|
1745 if (this->current_order.IsType(OT_GOTO_STATION) && | 1745 if (this->current_order.IsType(OT_GOTO_STATION) && |
1746 this->current_order.GetDestination() == this->last_station_visited) { | 1746 this->current_order.GetDestination() == this->last_station_visited) { |
1747 current_order.MakeLoading(true); | 1747 current_order.MakeLoading(true); |
1748 UpdateVehicleTimetable(this, true); | 1748 UpdateVehicleTimetable(this, true); |
1749 | 1749 |
1750 for (Order *order = this->GetOrder(this->cur_order_index); | 1750 const Order *order = this->GetOrder(this->cur_order_index); |
1751 order != NULL && order->IsType(OT_AUTOMATIC); | 1751 while (order != NULL && order->IsType(OT_AUTOMATIC)) { |
1752 order = order->next) { | 1752 /* Delete order effectively deletes order, so get the next before deleting it. */ |
1753 order = order->next; | |
1753 DeleteOrder(this, this->cur_order_index); | 1754 DeleteOrder(this, this->cur_order_index); |
1754 } | 1755 } |
1755 | 1756 |
1756 /* Furthermore add the Non Stop flag to mark that this station | 1757 /* Furthermore add the Non Stop flag to mark that this station |
1757 * is the actual destination of the vehicle, which is (for example) | 1758 * is the actual destination of the vehicle, which is (for example) |