1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-09 18:23:00 +00:00

rogueviz:: fixed multi-level scenes awarding goals incorrectly

This commit is contained in:
Zeno Rogue
2025-09-07 12:37:22 +02:00
parent 8616ffac39
commit 54f9f864f0
2 changed files with 8 additions and 8 deletions

View File

@@ -58,8 +58,8 @@ struct timestamp {
bool out_of_surface(level*);
void be_consistent();
bool check_crashes_rec(level*, hyperpoint owhere, hyperpoint oflyvel, ld timeleft);
bool check_crashes(level*, hyperpoint owhere, hyperpoint oflyvel, ld timeleft);
bool check_crashes_rec(level*, level*, hyperpoint owhere, hyperpoint oflyvel, ld timeleft);
bool check_crashes(level*, level*, hyperpoint owhere, hyperpoint oflyvel, ld timeleft);
};
struct planpoint {

View File

@@ -211,7 +211,7 @@ bool timestamp::tick(level *lev, ld time_left) {
vel = hypot_d(3, flyvel);
if(check_crashes_rec(lev, owhere, oflyvel, time_left)) return false;
if(check_crashes_rec(lev, lev, owhere, oflyvel, time_left)) return false;
}
circpos += circvel * time_left;
@@ -219,7 +219,7 @@ bool timestamp::tick(level *lev, ld time_left) {
return true;
}
bool timestamp::check_crashes(level* lev, hyperpoint owhere, hyperpoint oflyvel, ld time_left) {
bool timestamp::check_crashes(level *mainlev, level* lev, hyperpoint owhere, hyperpoint oflyvel, ld time_left) {
ld oz = lev->surface(owhere);
ld z = lev->surface(where);
@@ -282,14 +282,14 @@ bool timestamp::check_crashes(level* lev, hyperpoint owhere, hyperpoint oflyvel,
}
if(part == 1) return false;
return !tick(lev, time_left * (1 - part));
return !tick(mainlev, time_left * (1 - part));
}
return false;
}
bool timestamp::check_crashes_rec(level* l, hyperpoint owhere, hyperpoint oflyvel, ld time_left) {
if(check_crashes(l, owhere, oflyvel, time_left)) return true;
for(auto s: l->sublevels) if(check_crashes(s, owhere, oflyvel, time_left)) return true;
bool timestamp::check_crashes_rec(level *ml, level* l, hyperpoint owhere, hyperpoint oflyvel, ld time_left) {
if(check_crashes(ml, l, owhere, oflyvel, time_left)) return true;
for(auto s: l->sublevels) if(check_crashes(ml, s, owhere, oflyvel, time_left)) return true;
return false;
}