Allow: is_protected to work without player param
This commit is contained in:
parent
7fa6abd4aa
commit
c8f3528a43
@ -209,7 +209,7 @@ factions.register_command ("name", {
|
||||
return false
|
||||
end
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
factions.register_command ("claim", {
|
||||
faction_permissions = {"claim"},
|
||||
@ -265,7 +265,7 @@ factions.register_command ("claim", {
|
||||
factions.claim_help(player, arg_two)
|
||||
end
|
||||
end
|
||||
},true)
|
||||
}, true)
|
||||
|
||||
factions.register_command("unclaim", {
|
||||
faction_permissions = {"claim"},
|
||||
@ -321,7 +321,7 @@ factions.register_command("unclaim", {
|
||||
factions.unclaim_help(player, arg_two)
|
||||
end
|
||||
end
|
||||
},true)
|
||||
}, true)
|
||||
|
||||
--list all known factions
|
||||
factions.register_command("list", {
|
||||
@ -344,7 +344,7 @@ factions.register_command("list", {
|
||||
minetest.chat_send_player(player, tosend, false)
|
||||
return true
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
--show factions mod version
|
||||
factions.register_command("version", {
|
||||
@ -354,7 +354,7 @@ factions.register_command("version", {
|
||||
on_success = function(player, faction, pos, parcelpos, args)
|
||||
minetest.chat_send_player(player, "factions: version 0.8.8", false)
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
--show description of faction
|
||||
factions.register_command("info", {
|
||||
@ -369,7 +369,7 @@ factions.register_command("info", {
|
||||
args.factions[1].description, false)
|
||||
return true
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
factions.register_command("leave", {
|
||||
description = "Leave your faction",
|
||||
@ -379,7 +379,7 @@ factions.register_command("leave", {
|
||||
factions.remove_player(faction.name, player)
|
||||
return true
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
factions.register_command("kick", {
|
||||
faction_permissions = {"kick"},
|
||||
@ -405,7 +405,7 @@ factions.register_command("kick", {
|
||||
return false
|
||||
end
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
--create new faction
|
||||
factions.register_command("create", {
|
||||
@ -433,7 +433,7 @@ factions.register_command("create", {
|
||||
return false
|
||||
end
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
factions.register_command("join", {
|
||||
format = {"faction"},
|
||||
@ -461,7 +461,7 @@ factions.register_command("join", {
|
||||
|
||||
return true
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
factions.register_command("disband", {
|
||||
faction_permissions = {"disband"},
|
||||
@ -472,7 +472,7 @@ factions.register_command("disband", {
|
||||
factions.disband(faction.name)
|
||||
return true
|
||||
end
|
||||
},false)
|
||||
}, false)
|
||||
|
||||
factions.register_command("flag", {
|
||||
faction_permissions = {"flags"},
|
||||
@ -513,7 +513,7 @@ factions.register_command("flag", {
|
||||
end
|
||||
return true
|
||||
end
|
||||
},true)
|
||||
}, true)
|
||||
|
||||
factions.register_command("desc", {
|
||||
format = {"string"},
|
||||
|
@ -4,8 +4,7 @@ minetest.register_on_prejoinplayer(function(name, ip)
|
||||
factions.player_ips.set(name, ip)
|
||||
end)
|
||||
|
||||
minetest.register_on_joinplayer(
|
||||
function(player)
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
minetest.after(5, createHudfactionLand, player)
|
||||
local faction, facname = factions.get_player_faction(name)
|
||||
@ -40,8 +39,7 @@ function(player)
|
||||
end
|
||||
)
|
||||
|
||||
minetest.register_on_leaveplayer(
|
||||
function(player)
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
local faction, facname = factions.get_player_faction(name)
|
||||
local id_name1 = name .. "factionLand"
|
||||
@ -69,8 +67,7 @@ minetest.register_on_leaveplayer(
|
||||
end
|
||||
)
|
||||
|
||||
minetest.register_on_respawnplayer(
|
||||
function(player)
|
||||
minetest.register_on_respawnplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
local faction, facname = factions.get_player_faction(name)
|
||||
|
||||
@ -88,8 +85,7 @@ minetest.register_on_respawnplayer(
|
||||
end
|
||||
)
|
||||
|
||||
minetest.register_on_dieplayer(
|
||||
function(player)
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
local pname = player:get_player_name()
|
||||
if on_death[pname] then
|
||||
return
|
||||
|
@ -9,7 +9,11 @@ minetest.is_protected = function(pos, player)
|
||||
|
||||
local parcelpos = factions.get_parcel_pos(pos)
|
||||
local parcel_faction, parcel_fac_name = factions.get_parcel_faction(parcelpos)
|
||||
local player_faction, player_fac_name = factions.get_player_faction(player)
|
||||
local player_faction
|
||||
local player_fac_name
|
||||
if player then
|
||||
player_faction, player_fac_name = factions.get_player_faction(player)
|
||||
end
|
||||
|
||||
-- no faction
|
||||
if not parcel_faction then
|
||||
@ -33,4 +37,5 @@ minetest.is_protected = function(pos, player)
|
||||
else
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user