fix town creation
This commit is contained in:
parent
ea08c52b01
commit
24a7c30d62
@ -126,8 +126,8 @@ local function town_command (name, param)
|
||||
return towny.create_town(nil, name, pr2)
|
||||
elseif (pr1 == "invite" and not minetest.get_player_by_name(pr2)) then
|
||||
return invite_respond(name, (pr2:lower() == "accept" or minetest.is_yes(pr2)))
|
||||
elseif pr1 == "join" and towny.get_town_by_name(pr2) and not town then
|
||||
return join_town(pr2,name,false)
|
||||
elseif pr1 == "join" and not town then
|
||||
return join_town(towny.get_town_by_name(pr2), name, false)
|
||||
elseif pr1 == "show" or pr1 == "info" then
|
||||
if not towny.get_town_by_name(pr2) then
|
||||
return false, "No such town."
|
||||
|
@ -94,8 +94,8 @@ function towny.create_town(pos, player, name)
|
||||
return err_msg(player, "You're already in a town! Please leave your current town before founding a new one!")
|
||||
end
|
||||
|
||||
local _,__,distance = towny.regions.get_closest_town(pos)
|
||||
if distance < towny.regions.distance * towny.regions.size and not towny_admin then
|
||||
local tn,__,distance = towny.regions.get_closest_town(pos)
|
||||
if tn and distance < towny.regions.distance * towny.regions.size and not towny_admin then
|
||||
return err_msg(player, "This location is too close to another town!")
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user