src/pathfind.cpp
changeset 8480 1713959ed036
parent 8398 1e181e2e4e15
child 8611 9037a4227d67
equal deleted inserted replaced
8479:05ee5ae44a55 8480:1713959ed036
   285 				bits = KillFirstBit(bits);
   285 				bits = KillFirstBit(bits);
   286 
   286 
   287 				tpf->the_dir = (Trackdir)((_otherdir_mask[direction] & (byte)(1 << i)) ? (i + 8) : i);
   287 				tpf->the_dir = (Trackdir)((_otherdir_mask[direction] & (byte)(1 << i)) ? (i + 8) : i);
   288 				RememberData rd = tpf->rd;
   288 				RememberData rd = tpf->rd;
   289 
   289 
   290 				if (TPFSetTileBit(tpf, tile, tpf->the_dir) &&
   290 				/* make sure we are not leaving from invalid side */
       
   291 				if (TPFSetTileBit(tpf, tile, tpf->the_dir) && CanAccessTileInDir(tile, TrackdirToExitdir(tpf->the_dir), tpf->tracktype) &&
   291 						!tpf->enum_proc(tile, tpf->userdata, tpf->the_dir, tpf->rd.cur_length, &tpf->rd.pft_var6) ) {
   292 						!tpf->enum_proc(tile, tpf->userdata, tpf->the_dir, tpf->rd.cur_length, &tpf->rd.pft_var6) ) {
   292 					TPFMode1(tpf, tile, _tpf_new_direction[tpf->the_dir]);
   293 					TPFMode1(tpf, tile, _tpf_new_direction[tpf->the_dir]);
   293 				}
   294 				}
   294 				tpf->rd = rd;
   295 				tpf->rd = rd;
   295 			} while (bits != 0);
   296 			} while (bits != 0);