03.08.2016, 03:52
Are you loading the data correctly? Is the data saved correctly in the file? Adding a few prints across the script will give you more insight in what exactly happens.
I'm sorry, I didn't quite read all the code, but I'm assuming it's you loading the data incorrectly as it only occurs after a server restart (I'm assuming).
Also, if you bump into these kind of problems with such large functions, it's never bad to write comments and add debug messages. It helps you visualize the program's flow. Especially when you've got multidimensional arrays into multidimensional arrays. It's easy to fuck them up.
I'm sorry, I didn't quite read all the code, but I'm assuming it's you loading the data incorrectly as it only occurs after a server restart (I'm assuming).
Also, if you bump into these kind of problems with such large functions, it's never bad to write comments and add debug messages. It helps you visualize the program's flow. Especially when you've got multidimensional arrays into multidimensional arrays. It's easy to fuck them up.