The line
if ret and s >= 0.0 and s <= 1.0 and t >= 0.0 and t <= 0.0 then
should be the last test should t < 1.0 instead of t < 0.0
if ret and s >= 0.0 and s <= 1.0 and t >= 0.0 and t <= 1.0 then
but better the function could be rewritten more Lua like
function cc.pIsSegmentIntersect(pt1, pt2, pt3, pt4)
local ret, s, t =cc.pIsLineIntersect(pt1, pt2, pt3, pt4, s ,t)
return ret and s >= 0.0 and s <= 1.0 and t >= 0.0 and t <= 1.0
end
Thank you
Andre