Auto-translated
AstralLein, I can only say that it's better to check if a hero exists before performing any operation with him. Otherwise, it looks normal. You should check the debug messages; there might have been an error in the script earlier, and the interpreter simply didn't reach line 158 and didn't trigger the new day.