mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fixed new issue with hero trying to visit himself.
This commit is contained in:
		| @@ -752,7 +752,7 @@ TSubgoal GatherArmy::whatToDoToAchieve() | ||||
| 					return sptr (Goals::VisitHero(h->id.getNum()).setisAbstract(true).sethero(hero)); | ||||
| 						//go to the other hero if we are faster | ||||
| 				else | ||||
| 					return sptr (Goals::VisitHero(h->id.getNum()).setisAbstract(true).sethero(h)); | ||||
| 					return sptr (Goals::VisitHero(hero->id.getNum()).setisAbstract(true).sethero(h)); | ||||
| 						//let the other hero come to us | ||||
| 			} | ||||
| 		} | ||||
|   | ||||
| @@ -1220,8 +1220,10 @@ void VCAI::setGoal(HeroPtr h, Goals::TSubgoal goal) | ||||
| 	if (goal->invalid()) | ||||
| 		erase_if_present(lockedHeroes, h); | ||||
| 	else | ||||
| 	{ | ||||
| 		lockedHeroes[h] = goal; | ||||
| 		goal->setisElementar(false); //always evaluate goals before realizing | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void VCAI::completeGoal (Goals::TSubgoal goal) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user