mirror of
https://github.com/minetest-mods/mesecons.git
synced 2024-12-24 09:20:18 +01:00
Fix crash in microcontroller (#439)
Add check nil var with bug from crash server. fixes #438
This commit is contained in:
parent
45bbd9f7e3
commit
df4e880d8b
@ -571,6 +571,7 @@ yc.command_parsecondition = function(cond, L, eeprom)
|
||||
if cond:sub(i+1, i+1) == nil then break end
|
||||
if s == "&" then
|
||||
if a==nil then return nil end
|
||||
if b==nil then return nil end
|
||||
local buf = ((a==1) and (b==1))
|
||||
if buf == true then buf = "1" end
|
||||
if buf == false then buf = "0" end
|
||||
@ -580,6 +581,7 @@ yc.command_parsecondition = function(cond, L, eeprom)
|
||||
end
|
||||
if s == "|" then
|
||||
if a==nil then return nil end
|
||||
if b==nil then return nil end
|
||||
local buf = ((a == 1) or (b == 1))
|
||||
if buf == true then buf = "1" end
|
||||
if buf == false then buf = "0" end
|
||||
@ -589,6 +591,7 @@ yc.command_parsecondition = function(cond, L, eeprom)
|
||||
end
|
||||
if s == "~" then
|
||||
if a==nil then return nil end
|
||||
if b==nil then return nil end
|
||||
local buf = (((a == 1) or (b == 1)) and not((a==1) and (b==1)))
|
||||
if buf == true then buf = "1" end
|
||||
if buf == false then buf = "0" end
|
||||
|
Loading…
Reference in New Issue
Block a user