actboy168/jass2lua

对优先级判断错误导致转换失败

luciouskami opened this issue · 2 comments

init.lua:9: [war3map.j]第[818]行: 不能对[boolean]做负数运算
函数如下
function LQ takes unit u,unit u2,real r,real r2 returns boolean
return FQ(u,u2)-r<=(r2/360-2)*bj_PI or(FQ(u,u2)-r>=-(r2/360)*bj_PI and FQ(u,u2)-r<=(r2/360)*bj_PI)or FQ(u,u2)-r>=(2-r2/360)*bj_PI
endfunction

function c_isface2 takes unit u,unit u2,real r ,real r2 returns boolean
return c_face(u,u2)-r<=(r2/360-2)*bj_PI or (c_face(u,u2)-r>=-(r2/360)*bj_PI and c_face(u,u2)-r<=(r2/360)*bj_PI) or c_face(u,u2)-r>=(2-r2/360)*bj_PI
endfunction
这是一个判断单位是否在扇形内的函数

c4f9648 已修复