File diff r14167:e663f87c45ea → r14168:135d7d8d5e5b
src/station.cpp
Show inline comments
 
@@ -539,6 +539,30 @@ void TileArea::Add(TileIndex to_add)
 
	this->h    = ey - sy + 1;
 
}
 

	
 
bool TileArea::Intersects(const TileArea &ta) const
 
{
 
	if (ta.w == 0 || this->w == 0) return false;
 

	
 
	assert(ta.w != 0 && ta.h != 0 && this->w != 0 && this->h != 0);
 

	
 
	uint left1   = TileX(this->tile);
 
	uint top1    = TileY(this->tile);
 
	uint right1  = left1 + this->w - 1;
 
	uint bottom1 = top1  + this->h - 1;
 

	
 
	uint left2   = TileX(ta.tile);
 
	uint top2    = TileY(ta.tile);
 
	uint right2  = left2 + ta.w - 1;
 
	uint bottom2 = top2  + ta.h - 1;
 

	
 
	return !(
 
			left2   > right1  ||
 
			right2  < left1   ||
 
			top2    > bottom1 ||
 
			bottom2 < top1
 
		);
 
}
 

	
 

	
 
void InitializeStations()
 
{