From 43b4b761cc98b87c501b8fc5fc06f2cc8bff1c86 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 14 Mar 2020 22:26:23 +0000 Subject: [PATCH] Fix knight items being kept on first class change --- mods/ctf/ctf_classes/items.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mods/ctf/ctf_classes/items.lua b/mods/ctf/ctf_classes/items.lua index 6fb3996..35fc344 100644 --- a/mods/ctf/ctf_classes/items.lua +++ b/mods/ctf/ctf_classes/items.lua @@ -35,6 +35,10 @@ end ctf_classes.register_on_changed(function(player, old, new) local inv = player:get_inventory() + if not old then + old = ctf_classes.__classes[ctf_classes.default_class] + end + local blacklist = old.properties.item_blacklist if old and #blacklist > 0 then local blacklist_map = stack_list_to_map(blacklist)