The tbod variable does not get set when loading a save. Also looks like you forgot to check for tmax being true.