don't show results for 1-player "games"
This commit is contained in:
parent
02583495f1
commit
fd6e44e29c
16
game.lua
16
game.lua
@ -47,7 +47,11 @@ yl_snowball.update_hud = function(player)
|
||||
local game = games_by_player[player_name]
|
||||
local text = ""
|
||||
if game then
|
||||
text = game:get_info_string(true)
|
||||
if game.player_num > 1 then
|
||||
text = game:get_info_string(true)
|
||||
else
|
||||
text = ""
|
||||
end
|
||||
else
|
||||
game_hud:set_enabled(player, false)
|
||||
end
|
||||
@ -107,6 +111,7 @@ function Game:new()
|
||||
self.time_started = current_time
|
||||
self.time_last_action = current_time
|
||||
self.players = {}
|
||||
self.player_num = 0
|
||||
active_games[self] = true
|
||||
return self
|
||||
end
|
||||
@ -149,6 +154,7 @@ function Game:add_player(player_name, game_player)
|
||||
end
|
||||
self.players[player_name] = game_player
|
||||
games_by_player[player_name] = self
|
||||
self.player_num = self.player_num + 1
|
||||
end
|
||||
|
||||
|
||||
@ -202,9 +208,11 @@ function Game:stop()
|
||||
self:get_info_string(),
|
||||
}
|
||||
|
||||
for p_name, player in pairs(self.players) do
|
||||
if get_player_participation(p_name) then
|
||||
core.chat_send_player(p_name, table.concat(lines, "\n"))
|
||||
if self.player_num > 1 then
|
||||
for p_name, player in pairs(self.players) do
|
||||
if get_player_participation(p_name) then
|
||||
core.chat_send_player(p_name, table.concat(lines, "\n"))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user