Fix knight items being kept on first class change

This commit is contained in:
rubenwardy 2020-03-14 22:26:23 +00:00
parent 63726848ce
commit 43b4b761cc

View file

@ -35,6 +35,10 @@ end
ctf_classes.register_on_changed(function(player, old, new) ctf_classes.register_on_changed(function(player, old, new)
local inv = player:get_inventory() local inv = player:get_inventory()
if not old then
old = ctf_classes.__classes[ctf_classes.default_class]
end
local blacklist = old.properties.item_blacklist local blacklist = old.properties.item_blacklist
if old and #blacklist > 0 then if old and #blacklist > 0 then
local blacklist_map = stack_list_to_map(blacklist) local blacklist_map = stack_list_to_map(blacklist)