# HG changeset patch # User nemo # Date 1293073072 18000 # Node ID 6de386a42faef2bce89ef34ef0436535e1338315 # Parent e5b0fa933f7f30f6697486d53bbc60c3ab7a8e36 apparently some sanity checks are needed here. christmas theme object dimensions are crashing placement diff -r e5b0fa933f7f -r 6de386a42fae hedgewars/uLandObjects.pas --- a/hedgewars/uLandObjects.pas Wed Dec 22 21:36:17 2010 -0500 +++ b/hedgewars/uLandObjects.pas Wed Dec 22 21:57:52 2010 -0500 @@ -226,7 +226,9 @@ tmpx2:= bx; while (tmpx <= bx - rect.w div 2 - 1) and bRes do begin - bRes:= (Land[rect.y, tmpx] = Color) and (Land[by, tmpx] = Color) and + bRes:= ((rect.y and LAND_HEIGHT_MASK) = 0) and ((by and LAND_HEIGHT_MASK) = 0) and + ((tmpx and LAND_WIDTH_MASK) = 0) and ((tmpx2 and LAND_WIDTH_MASK) = 0) and + (Land[rect.y, tmpx] = Color) and (Land[by, tmpx] = Color) and (Land[rect.y, tmpx2] = Color) and (Land[by, tmpx2] = Color); inc(tmpx); dec(tmpx2) @@ -235,7 +237,9 @@ tmpy2:= by-1; while (tmpy <= by - rect.h div 2 - 1) and bRes do begin - bRes:= (Land[tmpy, rect.x] = Color) and (Land[tmpy, bx] = Color) and + bRes:= ((tmpy and LAND_HEIGHT_MASK) = 0) and ((tmpy2 and LAND_HEIGHT_MASK) = 0) and + ((rect.x and LAND_WIDTH_MASK) = 0) and ((bx and LAND_WIDTH_MASK) = 0) and + (Land[tmpy, rect.x] = Color) and (Land[tmpy, bx] = Color) and (Land[tmpy2, rect.x] = Color) and (Land[tmpy2, bx] = Color); inc(tmpy); dec(tmpy2)