mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	distance tester added
This commit is contained in:
		
							
								
								
									
										13
									
								
								debug.cpp
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								debug.cpp
									
									
									
									
									
								
							| @@ -516,6 +516,16 @@ void modalDebug(cell *c) { | |||||||
|   quitmainloop = false; |   quitmainloop = false; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | void test_distances(int max) { | ||||||
|  |   int ok = 0, bad = 0; | ||||||
|  |   celllister cl(cwt.at, max, 100000, NULL); | ||||||
|  |   for(cell *c: cl.lst) { | ||||||
|  |     bool is_ok = cl.getdist(c) == celldistance(c, cwt.at); | ||||||
|  |     if(is_ok) ok++; else bad++; | ||||||
|  |     } | ||||||
|  |   println(hlog, "ok=", ok, " bad=", bad); | ||||||
|  |   } | ||||||
|  |  | ||||||
| void raiseBuggyGeneration(cell *c, const char *s) { | void raiseBuggyGeneration(cell *c, const char *s) { | ||||||
|  |  | ||||||
|   printf("procgen error (%p): %s\n", c, s); |   printf("procgen error (%p): %s\n", c, s); | ||||||
| @@ -601,6 +611,9 @@ int read_cheat_args() { | |||||||
|     PHASE(3) cheat(); |     PHASE(3) cheat(); | ||||||
|     shift(); ambushval = argi(); |     shift(); ambushval = argi(); | ||||||
|     } |     } | ||||||
|  |   else if(argis("-testdistances")) { | ||||||
|  |     PHASE(3); shift(); test_distances(argi()); | ||||||
|  |     } | ||||||
|   else if(argis("-M")) { |   else if(argis("-M")) { | ||||||
|     PHASE(3) cheat(); |     PHASE(3) cheat(); | ||||||
|     shift(); eMonster m = readMonster(args()); |     shift(); eMonster m = readMonster(args()); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue