forked from mtcontrib/mobs_redo
		
	re-add nil check for get_distance function
This commit is contained in:
		
							
								
								
									
										2
									
								
								api.lua
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								api.lua
									
									
									
									
									
								
							@@ -196,7 +196,7 @@ end
 | 
				
			|||||||
-- calculate distance
 | 
					-- calculate distance
 | 
				
			||||||
local get_distance = function(a, b)
 | 
					local get_distance = function(a, b)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
--	if not a or not b then return 50 end -- nil check
 | 
						if not a or not b then return 50 end -- nil check
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local x, y, z = a.x - b.x, a.y - b.y, a.z - b.z
 | 
						local x, y, z = a.x - b.x, a.y - b.y, a.z - b.z
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user