diff --git a/game.cpp b/game.cpp index bdb3d673..323bb67d 100644 --- a/game.cpp +++ b/game.cpp @@ -700,7 +700,6 @@ bool passable(cell *w, cell *from, flagtype flags) { return true; } -int airdir; vector > airmap; int airdist(cell *c) { @@ -711,14 +710,13 @@ int airdist(cell *c) { return 3; } -void calcAirdir(cell *c) { +ld calcAirdir(cell *c) { if(!c || c->monst == moAirElemental || !passable(c, NULL, P_BLOW)) - return; + return 0; for(int i=0; itype; i++) { cell *c2 = c->move(i); if(c2 && c2->monst == moAirElemental) { - airdir = c->c.spin(i) * S42 / c2->type; - return; + return c->c.spin(i) * 2 * M_PI / c2->type; } } for(int i=0; itype; i++) { @@ -729,12 +727,11 @@ void calcAirdir(cell *c) { for(int i=0; itype; i++) { cell *c3 = c2->move(i); if(c3 && c3->monst == moAirElemental) { - airdir = c2->c.spin(i) * S42 / c3->type; - return; + return c2->c.spin(i) * 2 * M_PI / c3->type; } } } - return; + return 0; } bool againstWind(cell *cto, cell *cfrom) { diff --git a/graph.cpp b/graph.cpp index 57e6976a..cf5a86e1 100644 --- a/graph.cpp +++ b/graph.cpp @@ -5047,10 +5047,10 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { for(int i=0; itype; i++) { cell *c2 = c->move(i); if(airdist(c2) < airdist(c)) { - calcAirdir(c2); // printf("airdir = %d\n", airdir); + ld airdir = calcAirdir(c2); // printf("airdir = %d\n", airdir); transmatrix V0 = ddspin(c, i, M_PI); - double ph = ptick(PURE?150:75) + airdir * M_PI / (S21+.0); + double ph = ptick(PURE?150:75) + airdir; int aircol = 0x8080FF00 | int(32 + 32 * -cos(ph));