mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-24 13:27:17 +00:00
disabled color perturb if color not applicable
This commit is contained in:
parent
49877fbfc9
commit
edbf08b80c
@ -93,8 +93,9 @@ void buildhue() {
|
|||||||
|
|
||||||
int perturb(int c) {
|
int perturb(int c) {
|
||||||
if(nh == 0) buildhue();
|
if(nh == 0) buildhue();
|
||||||
int hueid = 0;
|
int hueid = -1;
|
||||||
for(int t=0; t<nh; t++) if(hues[t] == c) hueid = t;
|
for(int t=0; t<nh; t++) if(hues[t] == c) hueid = t;
|
||||||
|
if(hueid == -1) return c;
|
||||||
hueid += rand() % 50;
|
hueid += rand() % 50;
|
||||||
hueid -= rand() % 50;
|
hueid -= rand() % 50;
|
||||||
if(hueid<0) hueid += nh;
|
if(hueid<0) hueid += nh;
|
||||||
|
Loading…
Reference in New Issue
Block a user