mirror of
				https://github.com/minetest-mods/mesecons.git
				synced 2025-10-30 02:55:19 +01:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
			c1eccba247
			...
			patch_#135
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 7d8fd7a8df | 
| @@ -275,20 +275,15 @@ end | |||||||
| minetest.register_globalstep(execute_actions) | minetest.register_globalstep(execute_actions) | ||||||
|  |  | ||||||
| function add_action(pos, action, rname) | function add_action(pos, action, rname) | ||||||
| 	for _,i in ipairs(mesecon.to_update) do | 	for i, update in ipairs(mesecon.to_update) do | ||||||
| 		if i.pos.x == pos.x and i.pos.y == pos.y and i.pos.z == pos.z and i.rname.x == rname.x and i.rname.y == rname.y and i.rname.z == rname.z then | 		-- check if action for this node already exist, if so correct it: | ||||||
| 			if (i.action == "on" and action == "on") or (i.action == "off" and action == "off") then | 		if mesecon:cmpPos(pos, update.pos) and mesecon:cmpPos(update.rname, rname) then | ||||||
| 				--nothing | 			mesecon.to_update[i].action = action | ||||||
| 			elseif i.action == "coff" and action == "on" then i.action = "on" | 			return -- action added (as correction), so return now | ||||||
| 			elseif i.action == "con" and action == "off" then i.action = "off" |  | ||||||
| 			else |  | ||||||
| 				if action == "on" or action == "con" then i.action = "con" end |  | ||||||
| 				if action == "off" or action == "coff" then i.action = "coff" end |  | ||||||
| 			end |  | ||||||
| 			break |  | ||||||
| 		end | 		end | ||||||
| 	end | 	end | ||||||
| 	mesecon.to_update[#mesecon.to_update+1] = {pos = pos, action = action, rname = rname} |  | ||||||
|  | 	table.insert(mesecon.to_update, {pos = pos, action = action, rname = rname}) | ||||||
| end | end | ||||||
|  |  | ||||||
| --Rules | --Rules | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user