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:
committed by
Andrii Danylchenko
parent
3d91f2e988
commit
4c01a8eec4
@@ -21,6 +21,12 @@ namespace AIPathfinding
|
|||||||
{
|
{
|
||||||
void BuyArmyAction::execute(const CGHeroInstance * hero) const
|
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);
|
ai->recruitCreatures(hero->visitedTown, hero);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user