X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_player.pas;h=f277a4e8ab74fa5ce9992b49c8af0b215c4e5e27;hb=4c4a0406b07cdfd5051e388e8b00f02e008ed140;hp=2b7fec91097ceb5f23aef7edde48d186ff294ab1;hpb=91547a4c32733ddebebd278c42f290489daffa4e;p=d2df-sdl.git diff --git a/src/game/g_player.pas b/src/game/g_player.pas index 2b7fec9..f277a4e 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -21,7 +21,7 @@ interface 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; @@ -222,6 +222,8 @@ type procedure resetWeaponQueue (); function hasAmmoForWeapon (weapon: Byte): Boolean; + function getMapAABB (): AABB2D; + public FDamageBuffer: Integer; @@ -346,6 +348,8 @@ type 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 @@ -4998,6 +5002,11 @@ begin 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,