(svn r21940) -Fix [FS#4460]: Not all vehicles should be tested to be inside a tunnel upon savegame load (SmatZ)

This commit is contained in:
planetmaker 2011-02-02 16:46:42 +00:00
parent b15719bbd2
commit 0364726bbb
1 changed files with 4 additions and 0 deletions

View File

@ -2377,6 +2377,10 @@ bool AfterLoadGame()
* get messed up just after loading the savegame. This fixes that. */
Vehicle *v;
FOR_ALL_VEHICLES(v) {
/* Not all vehicle types can be inside a tunnel. Furthermore,
* testing IsTunnelTile() for invalid tiles causes a crash. */
if (!v->IsGroundVehicle()) continue;
/* Is the vehicle in a tunnel? */
if (!IsTunnelTile(v->tile)) continue;