From 8fc01b7ece41a3ba48143f204d0eb7cc390e04d8 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sun, 25 Sep 2022 18:56:01 +0200 Subject: [PATCH] Minor cleaning --- src/callbacks.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/callbacks.lua b/src/callbacks.lua index 3b65c26..490e570 100644 --- a/src/callbacks.lua +++ b/src/callbacks.lua @@ -203,16 +203,14 @@ local function init_data(player, info) local name = player:get_player_name() i3.data[name] = i3.data[name] or {} local data = i3.data[name] - local default = {} for k, v in pairs(i3.default_data) do - default[k] = data[k] - - if data[k] == nil then - default[k] = v + local val = data[k] + if val == nil then + val = v end - data[k] = default[k] + data[k] = val end data.player_name = name