From: fgsfds Date: Sun, 13 Aug 2017 16:54:24 +0000 (+0300) Subject: fixed segfault in bot ai X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=commitdiff_plain;h=6bf25c191cff05ba65bd1aaf28f63f105590a895 fixed segfault in bot ai --- diff --git a/src/game/g_player.pas b/src/game/g_player.pas index eea3f5d..b6a6bc1 100644 --- a/src/game/g_player.pas +++ b/src/game/g_player.pas @@ -6224,7 +6224,7 @@ var firew, fireh: Integer; angle: SmallInt; mon: TMonster; - pla: TPlayer; + pla, tpla: TPlayer; vsPlayer, vsMonster, ok: Boolean; begin vsPlayer := LongBool(gGameSettings.Options and GAME_OPTION_BOTVSPLAYER); @@ -6258,14 +6258,16 @@ begin if (g_GetUIDType(Target.UID) = UID_PLAYER) and vsPlayer then begin // Èãðîê - with g_Player_Get(Target.UID) do - begin - if (@FObj) <> nil then + tpla := g_Player_Get(Target.UID); + if tpla <> nil then + with tpla do begin - Target.X := FObj.X; - Target.Y := FObj.Y; + if (@FObj) <> nil then + begin + Target.X := FObj.X; + Target.Y := FObj.Y; + end; end; - end; Target.cX := Target.X + PLAYER_RECT_CX; Target.cY := Target.Y + PLAYER_RECT_CY;