fix double build
parent
dc078ff05c
commit
a142d7f860
2
init.lua
2
init.lua
|
@ -38,6 +38,7 @@ quikbild.storage = minetest.get_mod_storage()
|
||||||
state_time = 0,
|
state_time = 0,
|
||||||
artist = nil,
|
artist = nil,
|
||||||
word = '',
|
word = '',
|
||||||
|
has_built = {},
|
||||||
word_list = {},
|
word_list = {},
|
||||||
answer_list = {},
|
answer_list = {},
|
||||||
win_guesser = '',
|
win_guesser = '',
|
||||||
|
@ -48,7 +49,6 @@ quikbild.storage = minetest.get_mod_storage()
|
||||||
|
|
||||||
player_properties = {
|
player_properties = {
|
||||||
role = "",
|
role = "",
|
||||||
has_built = false,
|
|
||||||
score = 0,
|
score = 0,
|
||||||
lang = 1,
|
lang = 1,
|
||||||
kickvotes = 0,
|
kickvotes = 0,
|
||||||
|
|
|
@ -79,7 +79,7 @@ arena_lib.on_time_tick('quikbild', function(arena)
|
||||||
--choose the artist
|
--choose the artist
|
||||||
local artist_canidates = {}
|
local artist_canidates = {}
|
||||||
for pl_name,stats in pairs(arena.players) do
|
for pl_name,stats in pairs(arena.players) do
|
||||||
if stats.has_built == false then
|
if arena.has_built[pl_name] ~= true then
|
||||||
table.insert(artist_canidates,pl_name)
|
table.insert(artist_canidates,pl_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -129,7 +129,7 @@ arena_lib.on_time_tick('quikbild', function(arena)
|
||||||
|
|
||||||
local rand_art_idx = math.random(1,#artist_canidates)
|
local rand_art_idx = math.random(1,#artist_canidates)
|
||||||
arena.artist = artist_canidates[rand_art_idx]
|
arena.artist = artist_canidates[rand_art_idx]
|
||||||
arena.players[arena.artist].has_built = true --indicate that they were the artist
|
arena.has_built[arena.artist] = true --indicate that they were the artist
|
||||||
arena.state = 'build_think' --change the arena state so we dont run this code again
|
arena.state = 'build_think' --change the arena state so we dont run this code again
|
||||||
--send info messages
|
--send info messages
|
||||||
arena_lib.HUD_send_msg("broadcast", arena.artist, S('You are the Artist. Build the word you see'), 4 ,nil,0xFF0000)
|
arena_lib.HUD_send_msg("broadcast", arena.artist, S('You are the Artist. Build the word you see'), 4 ,nil,0xFF0000)
|
||||||
|
|
Loading…
Reference in New Issue