mirror of
				https://github.com/minetest-mods/mesecons.git
				synced 2025-11-04 04:55:26 +01:00 
			
		
		
		
	prevent crash with malformed sbi code.
just inserting "sbi(A, C!=D)" into a µC without connecting it to anything causes 'b' at line 510 to become nil, crashing the server.
This commit is contained in:
		@@ -505,6 +505,7 @@ function yc_command_parsecondition(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
 | 
			
		||||
			if a == b  then buf = "1" end
 | 
			
		||||
			if a ~= b then buf = "0" end
 | 
			
		||||
			cond = string.gsub(cond, b..s..a, buf)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user