rename c and id to c1 and c2 in alryslib.c
This commit is contained in:
parent
9a57494881
commit
14a4aa60c4
|
@ -105,7 +105,7 @@ void segments(double x1, double y1, double x2, double y2, double *lx, double *ly
|
|||
|
||||
void forward(struct STATE *state, double l)
|
||||
{
|
||||
int c, i, k, id, xr, in, ls;
|
||||
int c1, c2, i, k, xr, yr, in, ls;
|
||||
double a, d, destx, desty, lx[128], ly[128];
|
||||
|
||||
state->s -= 0.1;
|
||||
|
@ -118,19 +118,20 @@ void forward(struct STATE *state, double l)
|
|||
|
||||
for(k = 1; k < ls; ++k)
|
||||
{
|
||||
c = data[(int)(MIN(state->x, lx[k])) + (int)(MIN(state->y, ly[k])) * 146];
|
||||
id = data[(int)(lx[k]) + (int)(ly[k]) * 146];
|
||||
if(c == 1 || id == 1 || ((c == 3 || id == 3) && !state->boat)) break;
|
||||
xr = (int)(MIN(state->x, lx[k]));
|
||||
yr = (int)(MIN(state->y, ly[k]));
|
||||
c1 = data[xr + yr * 146];
|
||||
c2 = data[(int)(lx[k]) + (int)(ly[k]) * 146];
|
||||
if(c1 == 1 || c2 == 1 || ((c1 == 3 || c2 == 3) && !state->boat)) break;
|
||||
|
||||
d = hypot(lx[k] - state->x, ly[k] - state->y) * (0.2 + (c == 5) * 0.1 + (c == 4) * 0.2 + (c == 2) * 0.3);
|
||||
d = hypot(lx[k] - state->x, ly[k] - state->y) * (0.2 + (c1 == 5) * 0.1 + (c1 == 4) * 0.2 + (c1 == 2) * 0.3);
|
||||
state->s -= d;
|
||||
state->life -= d;
|
||||
|
||||
xr = (int)(MIN(state->x, lx[k]));
|
||||
state->x = lx[k];
|
||||
state->y = ly[k];
|
||||
|
||||
if(c == 7)
|
||||
if(c1 == 7)
|
||||
{
|
||||
in = 0;
|
||||
for(i = 0; i < state->dsize; ++i)
|
||||
|
@ -152,7 +153,7 @@ void forward(struct STATE *state, double l)
|
|||
}
|
||||
}
|
||||
|
||||
if(c == 6 && xr != state->vlast)
|
||||
if(c1 == 6 && xr != state->vlast)
|
||||
{
|
||||
if(!state->boat && state->dsize >= 9)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue