mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	CPathfinder::evaluateAccessibility: apply more optimizations
This commit is contained in:
		| @@ -619,14 +619,14 @@ CGPathNode::EAccessibility CPathfinder::evaluateAccessibility(const int3 & pos, | ||||
| 			{ | ||||
| 				for(const CGObjectInstance * obj : tinfo->visitableObjects) | ||||
| 				{ | ||||
| 					if(obj->passableFor(hero->tempOwner)) | ||||
| 					{ | ||||
| 						return CGPathNode::ACCESSIBLE; | ||||
| 					} | ||||
| 					else if(obj->blockVisit) | ||||
| 					if(obj->blockVisit) | ||||
| 					{ | ||||
| 						return CGPathNode::BLOCKVIS; | ||||
| 					} | ||||
| 					else if(obj->passableFor(hero->tempOwner)) | ||||
| 					{ | ||||
| 						return CGPathNode::ACCESSIBLE; | ||||
| 					} | ||||
| 					else if(canSeeObj(obj)) | ||||
| 					{ | ||||
| 						return CGPathNode::VISITABLE; | ||||
| @@ -634,13 +634,15 @@ CGPathNode::EAccessibility CPathfinder::evaluateAccessibility(const int3 & pos, | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		else if(guardingCreaturePosition(pos).valid() && !tinfo->blocked) | ||||
| 		else if(tinfo->blocked) | ||||
| 		{ | ||||
| 			return CGPathNode::BLOCKED; | ||||
| 		} | ||||
| 		else if(gs->guardingCreaturePosition(pos).valid()) | ||||
| 		{ | ||||
| 			// Monster close by; blocked visit for battle | ||||
| 			return CGPathNode::BLOCKVIS; | ||||
| 		} | ||||
| 		else if(tinfo->blocked) | ||||
| 			return CGPathNode::BLOCKED; | ||||
|  | ||||
| 		break; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user