X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_map.pas;h=b97cc00a24f2a3ed8a6a06dc51b9b10e54b850fd;hb=1ac9fc74d98d56a450774702aae19fa1546f2849;hp=1a7a4d8f18eb54d2add20148f04a97b20c4ec890;hpb=7d66e4504587cde0a3f9f3bbc0d48509a80c3056;p=d2df-sdl.git diff --git a/src/game/g_map.pas b/src/game/g_map.pas index 1a7a4d8..b97cc00 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -136,7 +136,7 @@ var gdbg_map_use_grid_render: Boolean = true; gdbg_map_use_grid_coldet: Boolean = true; - gdbg_map_use_tree_draw: Boolean = true; + gdbg_map_use_tree_draw: Boolean = false; gdbg_map_use_tree_coldet: Boolean = false; gdbg_map_dump_coldet_tree_queries: Boolean = false; profMapCollision: TProfiler = nil; //WARNING: FOR DEBUGGING ONLY! @@ -201,9 +201,14 @@ function TDynAABBTreeMap.getFleshAABB (var aabb: AABB2D; flesh: TTreeFlesh): Boo var pan: TPanel; begin - if (flesh = nil) then begin result := false; exit; end; + result := false; + if (flesh = nil) then exit; pan := (flesh as TPanel); + if (pan.Width < 1) or (pan.Height < 1) then exit; aabb := AABB2D.Create(pan.X, pan.Y, pan.X+pan.Width, pan.Y+pan.Height); + //if (pan.Width = 1) then aabb.maxX += 1; + //if (pan.Height = 1) then aabb.maxY += 1; + if not aabb.valid then raise Exception.Create('wutafuuuuuuu?!'); //e_WriteLog(Format('getFleshAABB(%d;%d) AABB:(%f,%f)-(%f,%f); valid=%d; volume=%f; x=%d; y=%d; w=%d; h=%d', [pan.tag, pan.ArrIdx, aabb.minX, aabb.minY, aabb.maxX, aabb.maxY, Integer(aabb.valid), aabb.volume, pan.X, pan.Y, pan.Width, pan.Height]), MSG_NOTIFY); result := aabb.valid; end;