Lunatic: fix ported A_FurthestVisiblePoint().

git-svn-id: https://svn.eduke32.com/eduke32@4141 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-11-08 18:08:40 +00:00
parent 77574e30b9
commit 84357152eb

View file

@ -1358,17 +1358,19 @@ local function A_FurthestVisiblePoint(aci, otherspr)
return return
end end
-- TODO_MP
local angincs = (ffiC.ud.player_skill < 3) and 1024 or 2048/(1+krandand(1)) local angincs = (ffiC.ud.player_skill < 3) and 1024 or 2048/(1+krandand(1))
local spr = sprite[aci]
local j = 0 local j = 0
repeat repeat
local ray = kangvec(otherspr.ang + j, 16384-krandand(32767)) local ray = kangvec(otherspr.ang + j, 16384-krandand(32767))
local hit = hitscan(otherspr^(16*256), otherspr.sectnum, ray, ffiC.CLIPMASK1) local hit = hitscan(otherspr^(16*256), otherspr.sectnum, ray, ffiC.CLIPMASK1)
local dother = manhatdist(hit.pos, otherspr) local dother = manhatdist(hit.pos, otherspr)
local dactor = manhatdist(hit.pos, sprite[aci]) local dactor = manhatdist(hit.pos, spr)
if (dother < dactor and hit.sector >= 0) then if (dother < dactor and hit.sector >= 0) then
if (cansee(hit.pos, hit.sector, otherspr^(16*256), otherspr.sectnum)) then if (cansee(hit.pos, hit.sector, spr^(16*256), spr.sectnum)) then
return hit return hit
end end
end end