User Tools

Site Tools


dev:core:funref:is_protected

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Last revision Both sides next revision
dev:core:funref:is_protected [2019-10-02 17:52]
82.67.173.193
dev:core:funref:is_protected [2019-10-02 20:18]
82.67.173.193 convert tabs to spaces
Line 43: Line 43:
 <file lua is_protected.lua> <file lua is_protected.lua>
 function advtrains.is_protected(pos, name) function advtrains.is_protected(pos, name)
- if not name then +    if not name then 
- error("advtrains.is_protected() called without name parameter!"+        error("advtrains.is_protected() called without name parameter!"
- end +    end 
- if minetest.check_player_privs(name, {protection_bypass=true}) then +    if minetest.check_player_privs(name, {protection_bypass=true}) then 
- --player can bypass protection +        --player can bypass protection 
- return false +        return false 
- end +    end 
- return minetest.is_protected(pos, name)+    return minetest.is_protected(pos, name)
 end end
 </file> </file>
dev/core/funref/is_protected.txt · Last modified: 2020-01-22 10:53 by admin