Fix generation problem in battle factory