Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
AI: fix freeze while endlesly trying to recruit hero #527
Conquer goal sometimes want to recruit a hero. If it is possible but is declined by ResourceManager because it has something more important or wants to save money it stores RecruitHero goal in its own cache and waits for a better time. When the better time happens we just want to execute RecruitHero elementar version as it was stored in elementar form in ResourceManager. The last more or less blindly tries to recruit hero and fails with cannotCompleteGoal exception. But the one path which checks presence of any tavern does not. It just does nothing and exits. So we try to recruit hero again and again and goal does nothing. It is not completed because it did not throw goalCompletedException nor it canceled because it did not threw cannotCompleteGoalException.