按 c 風格寫多條件判斷,會出異常, 如 if ( cond1& cond2 ){ do something; };
lua寫成
if cond1 and cond2 then
do something
end
這樣會出異常, 當 cond1 為false時直接返回 cond2 的值, cond2 true就會執行 do something了。
需要改為
if cond1 == true and cond2 == true then
do something
end
具體參考lua 的 and 和or 用法
http://blog.csdn.net/heyuchang666/article/details/51005550
