fix double build

master
MisterE 2022-06-30 12:54:59 -04:00
parent dc078ff05c
commit a142d7f860
2 changed files with 3 additions and 3 deletions

View File

@ -38,6 +38,7 @@ quikbild.storage = minetest.get_mod_storage()
state_time = 0,
artist = nil,
word = '',
has_built = {},
word_list = {},
answer_list = {},
win_guesser = '',
@ -48,7 +49,6 @@ quikbild.storage = minetest.get_mod_storage()
player_properties = {
role = "",
has_built = false,
score = 0,
lang = 1,
kickvotes = 0,

View File

@ -79,7 +79,7 @@ arena_lib.on_time_tick('quikbild', function(arena)
--choose the artist
local artist_canidates = {}
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)
end
end
@ -129,7 +129,7 @@ arena_lib.on_time_tick('quikbild', function(arena)
local rand_art_idx = math.random(1,#artist_canidates)
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
--send info messages
arena_lib.HUD_send_msg("broadcast", arena.artist, S('You are the Artist. Build the word you see'), 4 ,nil,0xFF0000)