1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

fixed a crash due to not using PIU in fieldval_uniq_rand

This commit is contained in:
Zeno Rogue 2019-08-20 13:15:18 +02:00
parent 7aed1b8551
commit 5a45c1c062
2 changed files with 7 additions and 1 deletions

View File

@ -30,7 +30,7 @@ struct fgeomextra {
extern int subpathid; extern int subpathid;
extern int subpathorder; extern int subpathorder;
#define MWDIM (WDIM+1) #define MWDIM (prod ? 3 : WDIM+1)
bool isprime(int n) { bool isprime(int n) {
for(int k=2; k<n; k++) if(n%k == 0) return false; for(int k=2; k<n; k++) if(n%k == 0) return false;

View File

@ -409,6 +409,12 @@ EX int fieldval_uniq(cell *c) {
} }
EX int fieldval_uniq_rand(cell *c, int randval) { EX int fieldval_uniq_rand(cell *c, int randval) {
if(prod) {
auto c1 = product::get_where(c).first;
int res;
product::in_underlying_map([&] { res = fieldval_uniq_rand(c1, randval); });
return res;
}
if(sphere || euclid || NONSTDVAR) if(sphere || euclid || NONSTDVAR)
// we do not care in these cases // we do not care in these cases
return fieldval_uniq(c); return fieldval_uniq(c);