forked from mtcontrib/hangglider
		
	Use core.global_exists method to check for globals
This commit is contained in:
		
							
								
								
									
										6
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								init.lua
									
									
									
									
									
								
							@@ -99,7 +99,7 @@ minetest.register_entity("hangglider:airstopper", { --A one-instant entity that
 | 
				
			|||||||
	end
 | 
						end
 | 
				
			||||||
})]]
 | 
					})]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if areas then
 | 
					if core.global_exists("areas") then
 | 
				
			||||||
	hangglider.flak = true
 | 
						hangglider.flak = true
 | 
				
			||||||
	-- chat command definition essentially copied from areas mod.
 | 
						-- chat command definition essentially copied from areas mod.
 | 
				
			||||||
	minetest.register_chatcommand("area_flak",{
 | 
						minetest.register_chatcommand("area_flak",{
 | 
				
			||||||
@@ -124,7 +124,7 @@ if areas then
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if minetestd and minetestd.services.physicsctl.enabled then
 | 
					if core.global_exists("minetestd") and minetestd.services.physicsctl.enabled then
 | 
				
			||||||
minetestd.physicsctl.register_physics_effect("hangglider",
 | 
					minetestd.physicsctl.register_physics_effect("hangglider",
 | 
				
			||||||
	function(player) -- check
 | 
						function(player) -- check
 | 
				
			||||||
		return hangglider.use[player:get_player_name()]
 | 
							return hangglider.use[player:get_player_name()]
 | 
				
			||||||
@@ -188,7 +188,7 @@ end
 | 
				
			|||||||
local function remove_physics_override(player, overrides)
 | 
					local function remove_physics_override(player, overrides)
 | 
				
			||||||
    for _, attr in pairs(physics_attrs) do
 | 
					    for _, attr in pairs(physics_attrs) do
 | 
				
			||||||
        if overrides[attr] then
 | 
					        if overrides[attr] then
 | 
				
			||||||
            if player_monoids then
 | 
					            if core.global_exists("player_monoids") then
 | 
				
			||||||
                player_monoids[attr]:del_change(player, "hangglider:glider")
 | 
					                player_monoids[attr]:del_change(player, "hangglider:glider")
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
                player:set_physics_override({[attr] = 1})
 | 
					                player:set_physics_override({[attr] = 1})
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user