1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-12-20 12:58:06 +00:00

Stop using the deprecated std::random_shuffle, for the benefit of MSVC.

And generalize `hrandom_shuffle` to take an arbitrary `Iter`,
so that passing `vec.begin()` will work even with MSVC's
debug iterators. (Passing `&vec[0]` or `vec.data()` would work
either way, but I'd worry that someone would forget to do that
conscientiously every time.)
This commit is contained in:
Arthur O'Dwyer
2018-06-27 15:21:59 -07:00
parent 62db7ee250
commit 1a93fbcd45
3 changed files with 2 additions and 3 deletions

View File

@@ -4732,7 +4732,7 @@ void movehex(bool mounted, int colorpair) {
for(int t=0; t<c->type; t++) if(c->mov[t] && inpair(c->mov[t], colorpair))
dirtable[qdirtable++] = t;
random_shuffle(dirtable, dirtable+qdirtable);
hrandom_shuffle(dirtable, qdirtable);
while(qdirtable--) {
int t = dirtable[qdirtable];
hexvisit(c->mov[t], c, t, mounted, colorpair);