# HG changeset patch # User rubidium # Date 2011-11-23 20:36:27 # Node ID 7f3f65acbe7c91bb4a1f2759b6bf02f910ce03e4 # Parent 9de8809c4a77c4d744f6902fcf4935b617521dfc (svn r23312) -Fix [FS#4849]: assertion could be triggered in case a station was removed just after a vehicle delivered cargo to it diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3027,8 +3027,8 @@ void TriggerWatchedCargoCallbacks(Statio */ 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; }