mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-03 04:39:17 +00:00
bounded racing improved
This commit is contained in:
parent
4a0f5dfb22
commit
9de1481b2a
20
racing.cpp
20
racing.cpp
@ -359,8 +359,14 @@ EX void block_cells(vector<cell*> to_block, function<bool(cell*)> blockbound) {
|
|||||||
|
|
||||||
EX void make_bounded_track(cell *s) {
|
EX void make_bounded_track(cell *s) {
|
||||||
|
|
||||||
celllister cl(s, TWIDTH, 1000000, NULL);
|
celllister cl(s, 999, 1000000, NULL);
|
||||||
for(cell *c: cl.lst) setdist(c, 0, NULL);
|
for(cell *c: cl.lst)
|
||||||
|
setdist(c, 0, NULL);
|
||||||
|
println(hlog, "cls = ", isize(cl.lst));
|
||||||
|
|
||||||
|
for(cell *c: cl.lst) {
|
||||||
|
c->item = itNone; c->wall = waNone; c->monst = moNone;
|
||||||
|
}
|
||||||
|
|
||||||
map<cell*, int> mazetype;
|
map<cell*, int> mazetype;
|
||||||
track.clear();
|
track.clear();
|
||||||
@ -380,9 +386,7 @@ EX void make_bounded_track(cell *s) {
|
|||||||
}
|
}
|
||||||
vector<cell*> to_block;
|
vector<cell*> to_block;
|
||||||
for(auto p: mazetype) {
|
for(auto p: mazetype) {
|
||||||
cell *c = p.first;
|
if(p.second == 2) to_block.push_back(p.first);
|
||||||
c->item = itNone; c->wall = waNone; c->monst = moNone;
|
|
||||||
if(p.second == 2) to_block.push_back(c);
|
|
||||||
}
|
}
|
||||||
block_cells(to_block, [] (cell *c) { return true; });
|
block_cells(to_block, [] (cell *c) { return true; });
|
||||||
for(cell *c: to_block) if(c->wall == waNone && !c->monst) c->wall = waBarrier;
|
for(cell *c: to_block) if(c->wall == waNone && !c->monst) c->wall = waBarrier;
|
||||||
@ -603,9 +607,9 @@ EX void generate_track() {
|
|||||||
}
|
}
|
||||||
if(!goal) {
|
if(!goal) {
|
||||||
printf("error: goal unreachable\n");
|
printf("error: goal unreachable\n");
|
||||||
gamegen_failure = true;
|
// gamegen_failure = true;
|
||||||
race_try++;
|
// race_try++;
|
||||||
return;
|
// return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user