conflicts resolved

This commit is contained in:
Zeno Rogue 2018-06-12 21:57:00 +02:00
commit 75b096c58d
3 changed files with 18 additions and 19 deletions

View File

@ -6,7 +6,8 @@
# Run "brew install sdl_ttf".
# Run "make -f Makefile.mac" to build HyperRogue as ./hyper.
CXXFLAGS += -std=c++11 -DMAC
CXXFLAGS += -std=c++11 -march=native -DMAC
# CXXFLAGS += -DCAP_ROGUEVIZ
CXXFLAGS += -W -Wall -Wextra -pedantic
CXXFLAGS += -Wno-format-pedantic -Wno-unused-parameter -Wno-char-subscripts -Wno-missing-field-initializers -Wno-vla-extension
CXXFLAGS += ${EXTRA_CXXFLAGS}
@ -19,7 +20,7 @@ hyper: hyper.o
hyper.o: *.cpp language-data.cpp
$(CXX) $(CXXFLAGS) -O2 -c hyper.cpp
langen: langen.cpp
langen: langen.cpp language-??.cpp language-ptbr.cpp
$(CXX) $(CXXFLAGS) -O0 -Wno-embedded-directive langen.cpp -o langen
# Generation of language-data.cpp

View File

@ -1157,8 +1157,6 @@ bool outlawNearby(cell *c, int dist) {
return false;
}
// int monstersnear(cell *c, cell *nocount = NULL, eMonster who = moPlayer, cell *pushto = NULL) {
namespace stalemate {
vector<stalemate1> moves;
bool nextturn;
@ -1197,12 +1195,12 @@ eMonster active_switch() {
vector<cell*> crush_now, crush_next;
int monstersnear(stalemate1& sm) {
bool monstersnear(stalemate1& sm) {
cell *c = sm.moveto;
bool eaten = false;
if(hardcore && sm.who == moPlayer) return 0;
if(hardcore && sm.who == moPlayer) return false;
int res = 0;
bool fast = false;
@ -1286,12 +1284,12 @@ int monstersnear(stalemate1& sm) {
if(sm.who == moPlayer && res && markOrb2(itOrbDomination) && c->monst)
res = 0;
return res;
return !!res;
}
namespace multi { bool aftermove; }
int monstersnear2();
bool monstersnear2();
int lastkills;
@ -1324,9 +1322,9 @@ bool swordConflict(const stalemate1& sm1, const stalemate1& sm2) {
return false;
}
int monstersnear2() {
bool monstersnear2() {
multi::cpid++;
int b = 0;
bool b = false;
bool recorduse[ittypes];
for(int i=0; i<ittypes; i++) recorduse[i] = orbused[i];
if(multi::cpid == multi::players || multi::players == 1 || multi::checkonly) {
@ -1355,13 +1353,13 @@ int monstersnear2() {
for(int i=0; i<size(stalemate::moves); i++)
for(int j=0; j<size(stalemate::moves); j++) if(i != j) {
if(swordConflict(stalemate::moves[i], stalemate::moves[j])) {
b = 1;
b = true;
which = moEnergySword;
}
if(multi::player[i].c == multi::player[j].c)
{ b = 1; which = moFireball; }
{ b = true; which = moFireball; }
if(celldistance(multi::player[i].c, multi::player[j].c) > 8)
{ b = 1; which = moAirball; }
{ b = true; which = moAirball; }
}
for(int i=0; !b && i<size(stalemate::moves); i++)
@ -1373,7 +1371,7 @@ int monstersnear2() {
return b;
}
int monstersnear(cell *c, cell *nocount, eMonster who, cell *pushto, cell *comefrom) {
bool monstersnear(cell *c, cell *nocount, eMonster who, cell *pushto, cell *comefrom) {
if(peace::on) return 0; // you are safe
@ -1415,7 +1413,7 @@ int monstersnear(cell *c, cell *nocount, eMonster who, cell *pushto, cell *comef
// dynamicval<eMonster> x7(stalemate::who, who);
int b;
bool b;
if(who == moPlayer && c->wall == waBigStatue) {
eWall w = comefrom->wall;
c->wall = waNone;

View File

@ -947,12 +947,12 @@ void useOrbOfDragon(cell *c) {
checkmoveO();
}
int monstersnearO(orbAction a, cell *c, cell *nocount, eMonster who, cell *pushto, cell *comefrom) {
bool monstersnearO(orbAction a, cell *c, cell *nocount, eMonster who, cell *pushto, cell *comefrom) {
// printf("[a = %d] ", a);
if(shmup::on) return 0;
if(shmup::on) return false;
if(a == roCheck && multi::players > 1)
return 1;
else if(a == roMultiCheck) return 0;
return true;
else if(a == roMultiCheck) return false;
else return monstersnear(c, nocount, who, pushto, comefrom);
}