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 game = games_by_player[player_name]
|
||||||
local text = ""
|
local text = ""
|
||||||
if game then
|
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
|
else
|
||||||
game_hud:set_enabled(player, false)
|
game_hud:set_enabled(player, false)
|
||||||
end
|
end
|
||||||
@ -107,6 +111,7 @@ function Game:new()
|
|||||||
self.time_started = current_time
|
self.time_started = current_time
|
||||||
self.time_last_action = current_time
|
self.time_last_action = current_time
|
||||||
self.players = {}
|
self.players = {}
|
||||||
|
self.player_num = 0
|
||||||
active_games[self] = true
|
active_games[self] = true
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
@ -149,6 +154,7 @@ function Game:add_player(player_name, game_player)
|
|||||||
end
|
end
|
||||||
self.players[player_name] = game_player
|
self.players[player_name] = game_player
|
||||||
games_by_player[player_name] = self
|
games_by_player[player_name] = self
|
||||||
|
self.player_num = self.player_num + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -202,9 +208,11 @@ function Game:stop()
|
|||||||
self:get_info_string(),
|
self:get_info_string(),
|
||||||
}
|
}
|
||||||
|
|
||||||
for p_name, player in pairs(self.players) do
|
if self.player_num > 1 then
|
||||||
if get_player_participation(p_name) then
|
for p_name, player in pairs(self.players) do
|
||||||
core.chat_send_player(p_name, table.concat(lines, "\n"))
|
if get_player_participation(p_name) then
|
||||||
|
core.chat_send_player(p_name, table.concat(lines, "\n"))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user