mirror of
				https://github.com/minetest-mods/areas.git
				synced 2025-10-31 13:05:21 +01:00 
			
		
		
		
	stylistic fixes etc
This commit is contained in:
		
							
								
								
									
										13
									
								
								api.lua
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								api.lua
									
									
									
									
									
								
							| @@ -6,24 +6,19 @@ areas.registerHudHandler = function(handler) | |||||||
| end | end | ||||||
|  |  | ||||||
| -- Generalized call to registered handlers to add their proeciton labels to the areas list | -- Generalized call to registered handlers to add their proeciton labels to the areas list | ||||||
| local detect_extra_protection = function(pos, area_list) | function areas:getRegisteredProtections(pos) | ||||||
|  | 	local area_list = {} | ||||||
| 	if #protection_detectors <= 0 then | 	if #protection_detectors <= 0 then | ||||||
| 		return area_list | 		return area_list | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
| 	for idx=1,#protection_detectors do | 	for idx=1, #protection_detectors do | ||||||
| 		local func = protection_detectors[idx] | 		local func = protection_detectors[idx] | ||||||
| 		area_list = func(pos,area_list) | 		area_list = func(pos, area_list) | ||||||
| 	end | 	end | ||||||
| 	return area_list | 	return area_list | ||||||
| end | end | ||||||
|  |  | ||||||
| function areas:getRegisteredProtections(pos) |  | ||||||
| 	local res = {} |  | ||||||
| 	res = detect_extra_protection(pos, res) |  | ||||||
| 	return res |  | ||||||
| end |  | ||||||
|  |  | ||||||
| --- Returns a list of areas that include the provided position. | --- Returns a list of areas that include the provided position. | ||||||
| function areas:getAreasAtPos(pos) | function areas:getAreasAtPos(pos) | ||||||
| 	local res = {} | 	local res = {} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user