mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fixed what merge-conflict-handling had broken.
Restored exploration-without relying on memory but with included whirlpool
This commit is contained in:
		| @@ -33,33 +33,30 @@ Goals::TGoalVec ExplorationBehavior::decompose(const Nullkiller * ai) const | |||||||
| { | { | ||||||
| 	Goals::TGoalVec tasks; | 	Goals::TGoalVec tasks; | ||||||
|  |  | ||||||
| 	for(auto obj : ai->memory->visitableObjs) | 	for (auto obj : ai->memory->visitableObjs) | ||||||
| 	{ | 	{ | ||||||
| 		switch (obj->ID.num) | 		switch (obj->ID.num) | ||||||
| 		{ | 		{ | ||||||
| 		case Obj::REDWOOD_OBSERVATORY: | 		case Obj::REDWOOD_OBSERVATORY: | ||||||
| 		case Obj::PILLAR_OF_FIRE: | 		case Obj::PILLAR_OF_FIRE: | ||||||
| 			{ | 		{ | ||||||
| 				auto rObj = dynamic_cast<const CRewardableObject*>(obj); | 			auto rObj = dynamic_cast<const CRewardableObject*>(obj); | ||||||
| 				if(!rObj->wasScouted(ai->playerID)) | 			if (!rObj->wasScouted(ai->playerID)) | ||||||
| 					tasks.push_back(sptr(Composition().addNext(ExplorationPoint(obj->visitablePos(), 200)).addNext(CaptureObject(obj)))); | 				tasks.push_back(sptr(Composition().addNext(ExplorationPoint(obj->visitablePos(), 200)).addNext(CaptureObject(obj)))); | ||||||
| 				break; | 			break; | ||||||
| 			} | 		} | ||||||
| 		case Obj::MONOLITH_ONE_WAY_ENTRANCE: | 		case Obj::MONOLITH_ONE_WAY_ENTRANCE: | ||||||
| 		case Obj::MONOLITH_TWO_WAY: | 		case Obj::MONOLITH_TWO_WAY: | ||||||
| 		case Obj::SUBTERRANEAN_GATE: | 		case Obj::SUBTERRANEAN_GATE: | ||||||
| 		case Obj::WHIRLPOOL: | 		case Obj::WHIRLPOOL: | ||||||
|  | 		{ | ||||||
|  | 			auto tObj = dynamic_cast<const CGTeleport*>(obj); | ||||||
|  | 			for (auto exit : cb->getTeleportChannelExits(tObj->channel)) | ||||||
| 			{ | 			{ | ||||||
| 				auto tObj = dynamic_cast<const CGTeleport *>(obj); | 				if (exit != tObj->id) | ||||||
| 				if(TeleportChannel::IMPASSABLE == ai->memory->knownTeleportChannels[tObj->channel]->passability) |  | ||||||
| 					break; |  | ||||||
| 				for(auto exit : ai->memory->knownTeleportChannels[tObj->channel]->exits) |  | ||||||
| 				{ | 				{ | ||||||
| 					if (exit != tObj->id) | 					if (!cb->isVisible(cb->getObjInstance(exit))) | ||||||
| 					{ | 						tasks.push_back(sptr(Composition().addNext(ExplorationPoint(obj->visitablePos(), 50)).addNext(CaptureObject(obj)))); | ||||||
| 						if (!cb->isVisible(cb->getObjInstance(exit))) |  | ||||||
| 							tasks.push_back(sptr(Composition().addNext(ExplorationPoint(obj->visitablePos(), 50)).addNext(CaptureObject(obj)))); |  | ||||||
| 					} |  | ||||||
| 				} | 				} | ||||||
| 			} | 			} | ||||||
| 		} | 		} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user