X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_basic.pas;h=367c0e1e87d1850a43fdfeca03ec9bc2b1368927;hb=a40ccefc0daf17edf117f5ff143842b398e2c6e5;hp=bc61b8887170a5898a4d7cbc79453b6f86916699;hpb=98283c5d58028cf0b5204c44412f51c4a15e98a6;p=d2df-sdl.git diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas index bc61b88..367c0e1 100644 --- a/src/game/g_basic.pas +++ b/src/game/g_basic.pas @@ -55,7 +55,6 @@ function g_CollidePlayer(X, Y: Integer; Width, Height: Word): Boolean; inline; function g_PatchLength(X1, Y1, X2, Y2: Integer): Word; function g_TraceVector(X1, Y1, X2, Y2: Integer): Boolean; // `true`: no wall hit function g_GetAcidHit(X, Y: Integer; Width, Height: Word): Byte; -function g_Look(a, b: PObj; d: TDirection): Boolean; procedure IncMax(var A: Integer; B, Max: Integer); overload; procedure IncMax(var A: Single; B, Max: Single); overload; procedure IncMax(var A: Integer; Max: Integer); overload; @@ -99,7 +98,7 @@ var implementation uses - Math, geom, e_log, g_map, g_gfx, g_player, SysUtils, MAPDEF, + Math, geom, e_log, g_map, g_player, SysUtils, MAPDEF, StrUtils, g_monsters, g_items, g_game; {$PUSH} @@ -565,23 +564,6 @@ begin Result := tab[a]; end; -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; - function GetAngle(baseX, baseY, pointX, PointY: Integer): SmallInt; var c: Single;