Fix line lengths

This commit is contained in:
rubenwardy 2015-07-16 17:15:34 +01:00
parent b306f36888
commit 211d1d2dec
2 changed files with 22 additions and 11 deletions

View File

@ -14,7 +14,8 @@ minetest.register_chatcommand("vote_kick", {
}, },
func = function(name, param) func = function(name, param)
if not minetest.get_player_by_name(param) then if not minetest.get_player_by_name(param) then
minetest.chat_send_player(name, "There is no player called '" .. param .. "'") minetest.chat_send_player(name, "There is no player called '" ..
param .. "'")
end end
vote.new_vote(name, { vote.new_vote(name, {

View File

@ -58,13 +58,16 @@ function vote.start_vote(voteset)
voteset:can_vote(name) then voteset:can_vote(name) then
local nextvote = vote.get_next_vote(name) local nextvote = vote.get_next_vote(name)
if nextvote == voteset then if nextvote == voteset then
minetest.chat_send_player(name, "Vote started: " .. voteset.description) minetest.chat_send_player(name,
"Vote started: " .. voteset.description)
if voteset.help then if voteset.help then
minetest.chat_send_player(name, voteset.help) minetest.chat_send_player(name, voteset.help)
end end
else else
minetest.chat_send_player(name, "A new vote started, please respond to this one first:") minetest.chat_send_player(name,
minetest.chat_send_player(name, "Next vote: " .. nextvote.description) "A new vote started, please respond to this one first:")
minetest.chat_send_player(name,
"Next vote: " .. nextvote.description)
if nextvote.help then if nextvote.help then
minetest.chat_send_player(name, nextvote.help) minetest.chat_send_player(name, nextvote.help)
end end
@ -169,13 +172,15 @@ minetest.register_chatcommand("yes", {
func = function(name, params) func = function(name, params)
local voteset = vote.get_next_vote(name) local voteset = vote.get_next_vote(name)
if not voteset then if not voteset then
minetest.chat_send_player(name, "There is no vote currently running!") minetest.chat_send_player(name,
"There is no vote currently running!")
return return
elseif not voteset.results.yes then elseif not voteset.results.yes then
minetest.chat_send_player(name, "The vote is not a yes/no one.") minetest.chat_send_player(name, "The vote is not a yes/no one.")
return return
elseif voteset.can_vote and not voteset:can_vote(name) then elseif voteset.can_vote and not voteset:can_vote(name) then
minetest.chat_send_player(name, "You can't vote in the currently active vote!") minetest.chat_send_player(name,
"You can't vote in the currently active vote!")
return return
end end
@ -190,13 +195,15 @@ minetest.register_chatcommand("no", {
func = function(name, params) func = function(name, params)
local voteset = vote.get_next_vote(name) local voteset = vote.get_next_vote(name)
if not voteset then if not voteset then
minetest.chat_send_player(name, "There is no vote currently running!") minetest.chat_send_player(name,
"There is no vote currently running!")
return return
elseif not voteset.results.no then elseif not voteset.results.no then
minetest.chat_send_player(name, "The vote is not a yes/no one.") minetest.chat_send_player(name, "The vote is not a yes/no one.")
return return
elseif voteset.can_vote and not voteset:can_vote(name) then elseif voteset.can_vote and not voteset:can_vote(name) then
minetest.chat_send_player(name, "You can't vote in the currently active vote!") minetest.chat_send_player(name,
"You can't vote in the currently active vote!")
return return
end end
@ -211,10 +218,12 @@ minetest.register_chatcommand("abstain", {
func = function(name, params) func = function(name, params)
local voteset = vote.get_next_vote(name) local voteset = vote.get_next_vote(name)
if not voteset then if not voteset then
minetest.chat_send_player(name, "There is no vote currently running!") minetest.chat_send_player(name,
"There is no vote currently running!")
return return
elseif voteset.can_vote and not voteset:can_vote(name) then elseif voteset.can_vote and not voteset:can_vote(name) then
minetest.chat_send_player(name, "You can't vote in the currently active vote!") minetest.chat_send_player(name,
"You can't vote in the currently active vote!")
return return
end end
@ -233,7 +242,8 @@ minetest.register_chatcommand("vote_kick", {
}, },
func = function(name, param) func = function(name, param)
if not minetest.get_player_by_name(param) then if not minetest.get_player_by_name(param) then
minetest.chat_send_player(name, "There is no player called '" .. param .. "'") minetest.chat_send_player(name, "There is no player called '" ..
param .. "'")
end end
vote.new_vote(name, { vote.new_vote(name, {