1
0
Fork 0

(svn r14536) -Fix (r14530): Do not expect uints to become negative.

release/0.7
frosch 2008-10-25 22:00:51 +00:00
parent 77a5a4953b
commit 896841403f
1 changed files with 5 additions and 5 deletions

View File

@ -1298,12 +1298,12 @@ static void DeliverGoodsToIndustry(const Station *st, CargoID cargo_type, int nu
if (st->rect.IsEmpty()) return; if (st->rect.IsEmpty()) return;
/* Compute acceptance rectangle */ /* Compute acceptance rectangle */
uint catchment_radius = st->GetCatchmentRadius(); int catchment_radius = st->GetCatchmentRadius();
Rect rect = { Rect rect = {
max(st->rect.left - catchment_radius, 0u), max<int>(st->rect.left - catchment_radius, 0),
max(st->rect.top - catchment_radius, 0u), max<int>(st->rect.top - catchment_radius, 0),
min(st->rect.right + catchment_radius, MapMaxX()), min<int>(st->rect.right + catchment_radius, MapMaxX()),
min(st->rect.bottom + catchment_radius, MapMaxY()) min<int>(st->rect.bottom + catchment_radius, MapMaxY())
}; };
/* Compute maximum extent of acceptance rectangle wrt. station sign */ /* Compute maximum extent of acceptance rectangle wrt. station sign */