mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 01:00:25 +00:00
polara50 and polarb50 now consistently return bool, not int.
MSVC complains about constructions such as bool polara50(int); int polara50(cell *c) { // ... return polara50(someint); }
This commit is contained in:
parent
2d5d5a1966
commit
f84975d1d1
@ -199,7 +199,7 @@ heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special) {
|
||||
cell *c = bf.at;
|
||||
|
||||
if(cdist50(c) != 0) return NULL;
|
||||
if(polarb50(c) != 1) return NULL;
|
||||
if(!polarb50(c)) return NULL;
|
||||
}
|
||||
|
||||
heptagon *alt = tailored_alloc<heptagon> (S7);
|
||||
|
4
hyper.h
4
hyper.h
@ -2734,7 +2734,7 @@ cell *createMovR(cell *c, int d);
|
||||
|
||||
bool ishept(cell *c);
|
||||
int cdist50(cell *c);
|
||||
int polarb50(cell *c);
|
||||
bool polarb50(cell *c);
|
||||
|
||||
bool isGravityLand(eLand l);
|
||||
bool isWarped(eLand l);
|
||||
@ -2952,7 +2952,7 @@ void sdltogl(SDL_Surface *txt, struct glfont_t& f, int ch);
|
||||
void showStartMenu();
|
||||
|
||||
bool polara50(int x);
|
||||
int polara50(cell *c);
|
||||
bool polara50(cell *c);
|
||||
int fiftyval049(cell *c);
|
||||
|
||||
namespace fieldpattern {
|
||||
|
@ -211,7 +211,7 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
|
||||
if(d == 9) {
|
||||
cell *c2 = NONSTDVAR ? c->master->c7 : c;
|
||||
if(cdist50(c2) == 3 && polarb50(c2) == 1)
|
||||
if(cdist50(c2) == 3 && polarb50(c2))
|
||||
c->wall = waPalace;
|
||||
}
|
||||
|
||||
@ -272,12 +272,12 @@ void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(cdist50(c) == 3 && polarb50(c) == 1 && !ishept(c)) {
|
||||
else if(cdist50(c) == 3 && polarb50(c) && !ishept(c)) {
|
||||
if(GOLDBERG) ;
|
||||
else {
|
||||
int q = 0, s = 0;
|
||||
if(!ishept(c)) for(int i=0; i<c->type; i++)
|
||||
if(cdist50(c->move(i)) == 3 && polarb50(c->move(i)) == 1 && !ishept(c->move(i)))
|
||||
if(cdist50(c->move(i)) == 3 && polarb50(c->move(i)) && !ishept(c->move(i)))
|
||||
q++, s += i;
|
||||
if(q == 1 && c->move(s)->land == laPalace) {
|
||||
switch(princess::generating ? 0 : hrand(2)) {
|
||||
|
15
pattern2.cpp
15
pattern2.cpp
@ -138,19 +138,19 @@ int land50(cell *c) {
|
||||
}
|
||||
}
|
||||
|
||||
int polara50(cell *c) {
|
||||
if(sphere || euclid || S7>7 || S6>6) return 0;
|
||||
bool polara50(cell *c) {
|
||||
if(sphere || euclid || S7>7 || S6>6) return false;
|
||||
else if(NONSTDVAR) return polara50(fiftyval(c->master->c7));
|
||||
else if(ctof(c)) return polara50(fiftyval(c));
|
||||
else {
|
||||
auto ar = gp::get_masters(c);
|
||||
for(int i=0; i<3; i++)
|
||||
if(cdist50(ar[i]->fiftyval) < 3) return polara50(ar[i]->fiftyval);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int polarb50(cell *c) {
|
||||
bool polarb50(cell *c) {
|
||||
if(euclid) return true;
|
||||
if(sphere || euclid || S7>7 || S6>6) return true;
|
||||
else if(NONSTDVAR) return polarb50(fiftyval(c->master->c7));
|
||||
@ -159,7 +159,7 @@ int polarb50(cell *c) {
|
||||
auto ar = gp::get_masters(c);
|
||||
for(int i=0; i<3; i++)
|
||||
if(cdist50(ar[i]->fiftyval) < 3) return polarb50(ar[i]->fiftyval);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,7 +189,8 @@ int fiftyval049(cell *c) {
|
||||
else if(sphere) return 0;
|
||||
else {
|
||||
int a[3], qa=0;
|
||||
int pa = polara50(c), pb = polarb50(c);
|
||||
bool pa = polara50(c);
|
||||
bool pb = polarb50(c);
|
||||
auto ar = gp::get_masters(c);
|
||||
for(int i=0; i<3; i++)
|
||||
if(polara50(ar[i]->fiftyval) == pa && polarb50(ar[i]->fiftyval) == pb)
|
||||
@ -2089,7 +2090,7 @@ namespace linepatterns {
|
||||
break;
|
||||
|
||||
case patPalace: {
|
||||
int a = polarb50(c);
|
||||
bool a = polarb50(c);
|
||||
if(pseudohept(c)) for(int i=0; i<7; i++) {
|
||||
cell *c1 = createMov(c, (i+3) % 7);
|
||||
cell *c2 = createMov(c, (i+4) % 7);
|
||||
|
Loading…
Reference in New Issue
Block a user