index 09322925bb7e21ce2935faaa9c104eae6d0c8e9b..d8c3fba04e3a4be5adae33bd8cd43d68d671475e 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
SysUtils, Classes,
mempool,
MAPDEF,
- g_basic, e_graphics, g_phys, g_textures, g_grid,
+ g_base, g_basic, g_phys, g_textures, g_grid,
g_saveload, g_panel, xprofiler;
const
implementation
uses
- e_log, e_texture, g_main, g_sound, g_gfx, g_player, g_game,
+ e_log, g_sound, g_gfx, g_player, g_game, r_textures, r_animations,
g_weapons, g_triggers, g_items, g_options,
g_console, g_map, Math, g_menu, wadreader,
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 ();