summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-23 20:36:27 +0000
committerrubidium <rubidium@openttd.org>2011-11-23 20:36:27 +0000
commit560bae8c915f78aeaeed4d3e941827a841b6bf53 (patch)
treeb73555497a8cf8a4068cc01434553313cd964462 /src
parentecbe29ecb7940a50c631acbae58934537b302e48 (diff)
downloadopenttd-560bae8c915f78aeaeed4d3e941827a841b6bf53.tar.xz
(svn r23312) -Fix [FS#4849]: assertion could be triggered in case a station was removed just after a vehicle delivered cargo to it
Diffstat (limited to 'src')
-rw-r--r--src/station_cmd.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp
index 177d2c786..b772da079 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3027,8 +3027,8 @@ void TriggerWatchedCargoCallbacks(Station *st)
*/
static bool StationHandleBigTick(BaseStation *st)
{
- if (!st->IsInUse() && ++st->delete_ctr >= 8) {
- delete st;
+ if (!st->IsInUse()) {
+ if (++st->delete_ctr >= 8) delete st;
return false;
}