X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_monsters.pas;h=36780ec4308c7f41d725717e48e6f7e04078b1cc;hp=f858d122dd8e8680a85b0ac52a1bdfba90f8b83e;hb=8f8d15ad51eda2346afdafbb5827baee4bda83e3;hpb=c5684c0c980bb96fd4fd0efae4d48cdeb469c8ff diff --git a/src/game/g_monsters.pas b/src/game/g_monsters.pas index f858d12..36780ec 100644 --- a/src/game/g_monsters.pas +++ b/src/game/g_monsters.pas @@ -494,6 +494,22 @@ uses g_language, g_netmsg, idpool, utils, xstreams; +function g_Look(a, b: PObj; d: TDirection): Boolean; +begin + if not gmon_dbg_los_enabled then begin result := false; exit; end; // always "wall hit" + + if ((b^.X > a^.X) and (d = TDirection.D_LEFT)) or + ((b^.X < a^.X) and (d = TDirection.D_RIGHT)) then + begin + Result := False; + Exit; + end; + + Result := g_TraceVector(a^.X+a^.Rect.X+(a^.Rect.Width div 2), + a^.Y+a^.Rect.Y+(a^.Rect.Height div 2), + b^.X+b^.Rect.X+(b^.Rect.Width div 2), + b^.Y+b^.Rect.Y+(b^.Rect.Height div 2)); +end; // ////////////////////////////////////////////////////////////////////////// // procedure g_Mons_ProfilersBegin ();