1
0
mirror of https://github.com/ComfyFactory/ComfyFactorio.git synced 2024-12-30 23:17:53 +02:00

comfy score - reset function

This commit is contained in:
Gerkiz 2020-12-29 00:02:11 +01:00
parent 8917facd2f
commit 822972a8e1

View File

@ -29,16 +29,29 @@ function Public.get_table()
return this
end
function Public.init_player_table(player)
function Public.reset_tbl()
this.score_table['player'] = {
players = {}
}
end
function Public.init_player_table(player, reset)
if not player then
return
end
if not this.score_table[player.force.name] then
this.score_table[player.force.name] = {}
if reset then
this.score_table[player.force.name].players[player.name] = {
built_entities = 0,
deaths = 0,
killscore = 0,
mined_entities = 0
}
end
if not this.score_table[player.force.name].players then
this.score_table[player.force.name].players = {}
end
if not this.score_table[player.force.name].players[player.name] then
this.score_table[player.force.name].players[player.name] = {
built_entities = 0,