Better args for protection style.

This commit is contained in:
Coder12a 2018-10-17 21:40:00 -05:00
parent 279d51037b
commit 67494969a3
3 changed files with 6 additions and 6 deletions

View File

@ -20,7 +20,7 @@ factions_config.protection_depth_height_limit = minetest.settings:get_bool("prot
factions_config.enable_power_per_player = minetest.settings:get_bool("power_per_playerb") or true
factions_config.attack_parcel = minetest.settings:get_bool("attack_parcel") or false
factions_config.faction_diplomacy = minetest.settings:get_bool("faction_diplomacy") or false
factions_config.protection_style = minetest.settings:get("protection_style") or "classic"
factions_config.protection_style = minetest.settings:get("protection_style") or "2d"
--[[
factions_config.protection_max_depth = -512
factions_config.protection_max_height = 10000
@ -42,5 +42,5 @@ factions_config.protection_depth_height_limit = true
factions_config.enable_power_per_player = true
factions_config.attack_parcel = false
factions_config.faction_diplomacy = false
factions_config.protection_style = "classic"
factions_config.protection_style = "2d"
--]]

View File

@ -670,9 +670,9 @@ function factions.Faction.on_revoke_invite(self, player)
end
function factions.get_parcel_pos(pos)
if factions_config.protection_style == "classic" then
if factions_config.protection_style == "2d" then
return math.floor(pos.x / factions_config.parcel_size)..","..math.floor(pos.z / factions_config.parcel_size)
elseif factions_config.protection_style == "pb-style" then
elseif factions_config.protection_style == "3d" then
return math.floor(pos.x / factions_config.parcel_size)..","..math.floor(pos.y / factions_config.parcel_size)..","..math.floor(pos.z / factions_config.parcel_size)
end
end

View File

@ -45,5 +45,5 @@ faction_diplomacy (Enable faction diplomacy) bool false
protection_depth_height_limit (Enable protection depth height limit) bool true
[StringSettings]
# Set the way that the parcel protection works (classic,pb-style).
protection_style (Protection style) string classic
# Set the way that the parcel protection works (2d,3d). 2d limits how far x and z can go but protection on the y goes up and down far. 3d limits all three axis.
protection_style (Protection style) string 2d