water_cmd.c
changeset 4090 0d2e6106082f
parent 4087 5ae6c880d66c
child 4101 b4c0a3c842f8
equal deleted inserted replaced
4089:f46bb713cde6 4090:0d2e6106082f
   640 		CreateEffectVehicleRel(v, 4, 4, 8, EV_EXPLOSION_LARGE);
   640 		CreateEffectVehicleRel(v, 4, 4, 8, EV_EXPLOSION_LARGE);
   641 		SndPlayVehicleFx(SND_12_EXPLOSION, v);
   641 		SndPlayVehicleFx(SND_12_EXPLOSION, v);
   642 	}
   642 	}
   643 }
   643 }
   644 
   644 
   645 // called from tunnelbridge_cmd
   645 // called from tunnelbridge_cmd, and by TileLoop_Industry()
   646 void TileLoop_Water(TileIndex tile)
   646 void TileLoop_Water(TileIndex tile)
   647 {
   647 {
   648 	static const TileIndexDiffC _tile_loop_offs_array[][5] = {
   648 	static const TileIndexDiffC _tile_loop_offs_array[][5] = {
   649 		// tile to mod																shore?				shore?
   649 		// tile to mod																shore?				shore?
   650 		{{-1,  0}, {0, 0}, {0, 1}, {-1,  0}, {-1,  1}},
   650 		{{-1,  0}, {0, 0}, {0, 1}, {-1,  0}, {-1,  1}},
   652 		{{ 1,  0}, {1, 0}, {1, 1}, { 2,  0}, { 2,  1}},
   652 		{{ 1,  0}, {1, 0}, {1, 1}, { 2,  0}, { 2,  1}},
   653 		{{ 0, -1}, {0, 0}, {1, 0}, { 0, -1}, { 1, -1}}
   653 		{{ 0, -1}, {0, 0}, {1, 0}, { 0, -1}, { 1, -1}}
   654 	};
   654 	};
   655 
   655 
   656 	/* Ensure sea-level canals do not flood */
   656 	/* Ensure sea-level canals do not flood */
   657 	if (!IsTileOwner(tile, OWNER_WATER)) return;
   657 	if (IsTileType(tile, MP_WATER) && !IsTileOwner(tile, OWNER_WATER)) return;
   658 
   658 
   659 	if (IS_INT_INSIDE(TileX(tile), 1, MapSizeX() - 3 + 1) &&
   659 	if (IS_INT_INSIDE(TileX(tile), 1, MapSizeX() - 3 + 1) &&
   660 			IS_INT_INSIDE(TileY(tile), 1, MapSizeY() - 3 + 1)) {
   660 			IS_INT_INSIDE(TileY(tile), 1, MapSizeY() - 3 + 1)) {
   661 		uint i;
   661 		uint i;
   662 
   662