mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-20 11:54:48 +00:00
distance tester added
This commit is contained in:
parent
cf57e9fc81
commit
8028392b70
13
debug.cpp
13
debug.cpp
@ -516,6 +516,16 @@ void modalDebug(cell *c) {
|
||||
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) {
|
||||
|
||||
printf("procgen error (%p): %s\n", c, s);
|
||||
@ -601,6 +611,9 @@ int read_cheat_args() {
|
||||
PHASE(3) cheat();
|
||||
shift(); ambushval = argi();
|
||||
}
|
||||
else if(argis("-testdistances")) {
|
||||
PHASE(3); shift(); test_distances(argi());
|
||||
}
|
||||
else if(argis("-M")) {
|
||||
PHASE(3) cheat();
|
||||
shift(); eMonster m = readMonster(args());
|
||||
|
Loading…
Reference in New Issue
Block a user