mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-10 10:43:03 +00:00
rogueviz:: fixed multi-level scenes awarding goals incorrectly
This commit is contained in:
@@ -58,8 +58,8 @@ struct timestamp {
|
|||||||
bool out_of_surface(level*);
|
bool out_of_surface(level*);
|
||||||
void be_consistent();
|
void be_consistent();
|
||||||
|
|
||||||
bool check_crashes_rec(level*, hyperpoint owhere, hyperpoint oflyvel, ld timeleft);
|
bool check_crashes_rec(level*, level*, hyperpoint owhere, hyperpoint oflyvel, ld timeleft);
|
||||||
bool check_crashes(level*, hyperpoint owhere, hyperpoint oflyvel, ld timeleft);
|
bool check_crashes(level*, level*, hyperpoint owhere, hyperpoint oflyvel, ld timeleft);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct planpoint {
|
struct planpoint {
|
||||||
|
|||||||
@@ -211,7 +211,7 @@ bool timestamp::tick(level *lev, ld time_left) {
|
|||||||
|
|
||||||
vel = hypot_d(3, flyvel);
|
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;
|
circpos += circvel * time_left;
|
||||||
@@ -219,7 +219,7 @@ bool timestamp::tick(level *lev, ld time_left) {
|
|||||||
return true;
|
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 oz = lev->surface(owhere);
|
||||||
ld z = lev->surface(where);
|
ld z = lev->surface(where);
|
||||||
|
|
||||||
@@ -282,14 +282,14 @@ bool timestamp::check_crashes(level* lev, hyperpoint owhere, hyperpoint oflyvel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(part == 1) return false;
|
if(part == 1) return false;
|
||||||
return !tick(lev, time_left * (1 - part));
|
return !tick(mainlev, time_left * (1 - part));
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool timestamp::check_crashes_rec(level* l, hyperpoint owhere, hyperpoint oflyvel, ld time_left) {
|
bool timestamp::check_crashes_rec(level *ml, level* l, hyperpoint owhere, hyperpoint oflyvel, ld time_left) {
|
||||||
if(check_crashes(l, owhere, oflyvel, time_left)) return true;
|
if(check_crashes(ml, l, owhere, oflyvel, time_left)) return true;
|
||||||
for(auto s: l->sublevels) if(check_crashes(s, owhere, oflyvel, time_left)) return true;
|
for(auto s: l->sublevels) if(check_crashes(ml, s, owhere, oflyvel, time_left)) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user