game: Clean ups of update_flags()

Add comments, improve variable naming, don't use unecessary global vars.