1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-17 07:07:38 +00:00

fixed an error with ptds going beyond the end of array

This commit is contained in:
Zeno Rogue
2025-06-07 17:01:23 +02:00
parent 905f88e8cb
commit 625df0f009

View File

@@ -2631,8 +2631,7 @@ EX void drawqueue() {
for(PPR p: {PPR::TRANSPARENT_WALL}) { for(PPR p: {PPR::TRANSPARENT_WALL}) {
int pp = int(p); int pp = int(p);
if(qp0[pp] == qp[pp]) continue; sort(ptds.data() + qp0[pp], ptds.data() + qp[pp],
sort(&ptds[qp0[int(p)]], &ptds[qp[int(p)]],
[] (const unique_ptr<drawqueueitem>& p1, const unique_ptr<drawqueueitem>& p2) { [] (const unique_ptr<drawqueueitem>& p1, const unique_ptr<drawqueueitem>& p2) {
return p1->subprio > p2->subprio; return p1->subprio > p2->subprio;
}); });
@@ -2651,7 +2650,7 @@ EX void drawqueue() {
h = unshift(d->V) * h; h = unshift(d->V) * h;
return h[2]; return h[2];
}; };
sort(&ptds[qp0[int(p)]], &ptds[qp[int(p)]], sort(ptds.data() + qp0[pp], ptds.data() + qp[pp],
[&] (const unique_ptr<drawqueueitem>& p1, const unique_ptr<drawqueueitem>& p2) { [&] (const unique_ptr<drawqueueitem>& p1, const unique_ptr<drawqueueitem>& p2) {
return get_z(p1) > get_z(p2); return get_z(p1) > get_z(p2);
}); });