summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cf04301)
raw | patch | inline | side by side (parent: cf04301)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 Aug 2017 18:37:33 +0000 (21:37 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Fri, 18 Aug 2017 18:37:48 +0000 (21:37 +0300) |
src/game/g_map.pas | patch | blob | history |
diff --git a/src/game/g_map.pas b/src/game/g_map.pas
index b97cc00a24f2a3ed8a6a06dc51b9b10e54b850fd..7334c3e184c3dad142fbf51a546bb195793f4b2b 100644 (file)
--- a/src/game/g_map.pas
+++ b/src/game/g_map.pas
pan: TPanel;
begin
result := false;
- if (flesh = nil) then exit;
+ if (flesh = nil) then begin aabb := AABB2D.Create(0, 0, 0, 0); exit; end;
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) or (pan.Height < 1) then exit;
//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;