What? No I didn't. Maybe I made you think of it.
Anyway, I see a bug in your code. What if initially the mob
or friends list is empty? You go to add 1 mob
. #oldmobs == 0 so it does oldmobs = settings.profile.mobs. mobs is empty so #oldmobs still == 0. It adds the mob
. Then you add another mob
. #oldmobs still == 0 so it does oldmobs = settings.profile.mobs which adds the first mob
to oldmobs which is not what you want. The initial mob
list was empty so oldmobs should remain empty.
Maybe you could start with oldmobs/friends == nil and do
Code: Select all
if oldmobs == nil then
oldmobs = settings.profile.mobs
Then it should save an empty table too.