1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-19 15:20:27 +00:00

fixed an iterator invalidation bug in drawStandard

This commit is contained in:
Zeno Rogue 2018-11-30 17:17:06 +01:00
parent 851e217a73
commit c6aa79b0dd

View File

@ -779,6 +779,10 @@ void drawStandard() {
drawn_cells.clear();
drawn_cells.emplace_back(viewctr, hsOrigin, cview(), band_shift);
for(int i=0; i<isize(drawn_cells); i++) {
// prevent reallocation due to insertion
if(drawn_cells.capacity() < drawn_cells.size() + 16)
drawn_cells.reserve(min<size_t>(2 * drawn_cells.size(), 128));
const auto& dc = drawn_cells[i];
auto& hs = get<0>(dc);
auto& s = get<1>(dc);