1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-02 02:37:55 +00:00

Fix UB when sorting empty vecs

This commit is contained in:
Jesse Ruderman
2021-07-11 20:54:25 -07:00
parent 08cbe8e4e0
commit 123994bdc2
6 changed files with 7 additions and 7 deletions

View File

@@ -852,7 +852,7 @@ EX void ambush(cell *c, int dogs) {
int v = valence();
if(v > 4) {
for(cell *c: cl.lst) if(cl.getdist(c) == d) around.push_back(c);
hrandom_shuffle(&around[0], isize(around));
hrandom_shuffle(around);
}
else {
for(int tries=0; tries<10000; tries++) {