对优先级判断错误导致转换失败
luciouskami opened this issue · 2 comments
luciouskami commented
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
luciouskami commented
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
这是一个判断单位是否在扇形内的函数