summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 53a5323)
raw | patch | inline | side by side (parent: 53a5323)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Wed, 9 Jun 2021 10:42:03 +0000 (13:42 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Fri, 9 Jun 2023 07:44:39 +0000 (10:44 +0300) |
src/game/g_basic.pas | patch | blob | history | |
src/game/g_monsters.pas | patch | blob | history |
diff --git a/src/game/g_basic.pas b/src/game/g_basic.pas
index bc61b8887170a5898a4d7cbc79453b6f86916699..60b6a966f46c8ee97a88c192a9c82e481ce3ea17 100644 (file)
--- a/src/game/g_basic.pas
+++ b/src/game/g_basic.pas
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;
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;
index d55b6bbc27ff7d46dcfc4d36af16fee8314ecaf6..11c98dab8a4fadd8f0f16fe4d7f506d92d942955 100644 (file)
--- a/src/game/g_monsters.pas
+++ b/src/game/g_monsters.pas
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 ();