From a088fae0e4f25958b6724ec10046896274277e25 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Mon, 4 Mar 2019 21:32:23 +0100 Subject: [PATCH] Compatibility with old loadouts prior to components update, fixes #194 --- server/main.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/main.lua b/server/main.lua index 26033bac..48853eaf 100644 --- a/server/main.lua +++ b/server/main.lua @@ -179,6 +179,13 @@ AddEventHandler('es:playerLoaded', function(source, _player) if result[1].loadout ~= nil then userData.loadout = json.decode(result[1].loadout) + + -- Compatibility with old loadouts prior to components update + for k,v in ipairs(userData.loadout) do + if v.components == nil then + v.components = {} + end + end end if result[1].position ~= nil then