1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-15 20:03:15 +02:00

Nullkiller: fix a few crashes

This commit is contained in:
Andrii Danylchenko
2021-05-16 15:00:37 +03:00
committed by Andrii Danylchenko
parent 3d91f2e988
commit 4c01a8eec4

View File

@@ -21,6 +21,12 @@ namespace AIPathfinding
{
void BuyArmyAction::execute(const CGHeroInstance * hero) const
{
if(!hero->visitedTown)
{
throw cannotFulfillGoalException(
hero->name + " being at " + hero->visitablePos().toString() + " has no town to recruit creatures.");
}
ai->recruitCreatures(hero->visitedTown, hero);
}