diff --git a/src/game/g_player.pas b/src/game/g_player.pas
index 612a4fb0aee855f664ae797deb1113959ba59583..f277a4e8ab74fa5ce9992b49c8af0b215c4e5e27 100644 (file)
--- a/src/game/g_player.pas
+++ b/src/game/g_player.pas
uses
e_graphics, g_playermodel, g_basic, g_textures,
g_weapons, g_phys, g_sound, g_saveload, MAPSTRUCT,
- BinEditor, g_panel;
+ BinEditor, g_panel, z_aabbtree;
const
KEY_LEFT = 1;
procedure resetWeaponQueue ();
function hasAmmoForWeapon (weapon: Byte): Boolean;
+ function getMapAABB (): AABB2D;
+
public
FDamageBuffer: Integer;
property UID: Word read FUID write FUID;
property JustTeleported: Boolean read FJustTeleported write FJustTeleported;
property NetTime: LongWord read FNetTime write FNetTime;
+
+ property mapAABB: AABB2D read getMapAABB;
end;
TDifficult = record
if FKeys[b].Time = 0 then FKeys[b].Pressed := False else Dec(FKeys[b].Time);
end;
+function TPlayer.getMapAABB (): AABB2D; inline;
+begin
+ result := AABB2D.CreateWH(FObj.X+PLAYER_RECT.X, FObj.Y+PLAYER_RECT.Y, PLAYER_RECT.Width, PLAYER_RECT.Height);
+end;
+
function TPlayer.Collide(X, Y: Integer; Width, Height: Word): Boolean;
begin
Result := g_Collide(FObj.X+PLAYER_RECT.X,
vsPlayer, vsMonster, ok: Boolean;
- function monsUpdate (monidx: Integer; mon: TMonster): Boolean;
+ function monsUpdate (mon: TMonster): Boolean;
begin
result := false; // don't stop
- if (mon <> nil) and (mon.Live) and (mon.MonsterType <> MONSTER_BARREL) then
+ if mon.Live and (mon.MonsterType <> MONSTER_BARREL) then
begin
if not TargetOnScreen(mon.Obj.X+mon.Obj.Rect.X, mon.Obj.Y+mon.Obj.Rect.Y) then exit;