mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	fixed a bug in celldistance_534
This commit is contained in:
		
							
								
								
									
										5
									
								
								reg3.cpp
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								reg3.cpp
									
									
									
									
									
								
							| @@ -2585,13 +2585,13 @@ int celldistance_534(cell *c1, cell *c2) { | ||||
|  | ||||
|   vector<cell*> s1 = {c1}; | ||||
|   vector<cell*> s2 = {c2}; | ||||
|   int best = DISTANCE_UNKNOWN; | ||||
|   int best = DISTANCE_UNKNOWN_BIG; | ||||
|   int d0 = 0; | ||||
|  | ||||
|   auto go_nearer = [&] (vector<cell*>& v, int& d) { | ||||
|     vector<cell*> w; | ||||
|     for(cell *c: v) | ||||
|       forCellEx(c1, c)  | ||||
|       forCellCM(c1, c) | ||||
|         if(celldist(c1) < d) | ||||
|           w.push_back(c1); | ||||
|     sort(w.begin(), w.end()); | ||||
| @@ -2612,6 +2612,7 @@ int celldistance_534(cell *c1, cell *c2) { | ||||
|     if(d1 >= d2) go_nearer(s1, d1); | ||||
|     if(d1 < d2) go_nearer(s2, d2); | ||||
|     } | ||||
|   if(best == DISTANCE_UNKNOWN_BIG) best = DISTANCE_UNKNOWN; /* just in case */ | ||||
|    | ||||
|   return best;   | ||||
|   } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue