|
|
@ -319,11 +319,25 @@ stepmove_player (int pl_nr)
|
|
|
|
_pos.x = p->pos.x & 255;
|
|
|
|
_pos.x = p->pos.x & 255;
|
|
|
|
_pos.y = p->pos.y & 255;
|
|
|
|
_pos.y = p->pos.y & 255;
|
|
|
|
|
|
|
|
|
|
|
|
if (_pos.x == 0 && _pos.y == 0 && map.field[fpos.x][fpos.y].type == FT_tunnel && p->tunnelto == -1) {
|
|
|
|
if (_pos.x == 0 && _pos.y == 0 && map.field[fpos.x][fpos.y].type == FT_tunnel
|
|
|
|
|
|
|
|
&& p->tunnelto == -1) {
|
|
|
|
|
|
|
|
d_printf ("Tunnel [%d] Player %s is going to (%d,%d)\n",
|
|
|
|
|
|
|
|
map.field[fpos.x][fpos.y].special, p->name,
|
|
|
|
|
|
|
|
map.tunnel[map.field[fpos.x][fpos.y].special].x,
|
|
|
|
|
|
|
|
map.tunnel[map.field[fpos.x][fpos.y].special].y);
|
|
|
|
d.x = d.y = 0;
|
|
|
|
d.x = d.y = 0;
|
|
|
|
p->pos.x = map.tunnel[map.field[fpos.x][fpos.y].special].x << 8;
|
|
|
|
if (map.
|
|
|
|
p->pos.y = map.tunnel[map.field[fpos.x][fpos.y].special].y << 8;
|
|
|
|
bfield[map.tunnel[map.field[fpos.x][fpos.y].special].x][map.
|
|
|
|
p->tunnelto = GAME_TUNNEL_TO;
|
|
|
|
tunnel[map.
|
|
|
|
|
|
|
|
field[fpos.x][fpos.
|
|
|
|
|
|
|
|
y].
|
|
|
|
|
|
|
|
special].y])
|
|
|
|
|
|
|
|
d_printf (" *** End of tunnel is with an bomb.\n");
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
p->pos.x = map.tunnel[map.field[fpos.x][fpos.y].special].x << 8;
|
|
|
|
|
|
|
|
p->pos.y = map.tunnel[map.field[fpos.x][fpos.y].special].y << 8;
|
|
|
|
|
|
|
|
p->tunnelto = GAME_TUNNEL_TO;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -383,9 +397,9 @@ move_player (int pl_nr)
|
|
|
|
/* network packet send control - send data if it's time to send or if we need to */
|
|
|
|
/* network packet send control - send data if it's time to send or if we need to */
|
|
|
|
if (bman.gametype != GT_single)
|
|
|
|
if (bman.gametype != GT_single)
|
|
|
|
net_game_send_playermove (pl_nr, (p->old_m == 0));
|
|
|
|
net_game_send_playermove (pl_nr, (p->old_m == 0));
|
|
|
|
if (p->tunnelto==0)
|
|
|
|
if (p->tunnelto == 0)
|
|
|
|
p->tunnelto = -1;
|
|
|
|
p->tunnelto = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* the player just stopt moving so send data */
|
|
|
|
/* the player just stopt moving so send data */
|
|
|
|
if (bman.gametype != GT_single && p->m == 0 && p->old_m != 0)
|
|
|
|
if (bman.gametype != GT_single && p->m == 0 && p->old_m != 0)
|
|
|
@ -393,21 +407,21 @@ move_player (int pl_nr)
|
|
|
|
p->old_m = p->m; // save the old state
|
|
|
|
p->old_m = p->m; // save the old state
|
|
|
|
p->m = 0;
|
|
|
|
p->m = 0;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
/* check the players position */
|
|
|
|
|
|
|
|
if ((p->pos.x & 0xFF) > EXPLOSION_SAVE_DISTANCE && (p->d == left || p->d == right))
|
|
|
|
/* check the players position */
|
|
|
|
if (!check_field ((p->pos.x >> 8) + 1, (p->pos.y >> 8)))
|
|
|
|
if ((p->pos.x & 0xFF) > EXPLOSION_SAVE_DISTANCE && (p->d == left || p->d == right))
|
|
|
|
player_died (p, -1);
|
|
|
|
if (!check_field ((p->pos.x >> 8) + 1, (p->pos.y >> 8)))
|
|
|
|
if ((p->pos.y & 0xFF) > EXPLOSION_SAVE_DISTANCE && (p->d == up || p->d == down))
|
|
|
|
player_died (p, -1);
|
|
|
|
if (!check_field ((p->pos.x >> 8), (p->pos.y >> 8) + 1))
|
|
|
|
if ((p->pos.y & 0xFF) > EXPLOSION_SAVE_DISTANCE && (p->d == up || p->d == down))
|
|
|
|
player_died (p, -1);
|
|
|
|
if (!check_field ((p->pos.x >> 8), (p->pos.y >> 8) + 1))
|
|
|
|
if (((p->pos.x & 0xFF) < (0x100 - EXPLOSION_SAVE_DISTANCE)
|
|
|
|
player_died (p, -1);
|
|
|
|
&& (p->d == left || p->d == right))
|
|
|
|
if (((p->pos.x & 0xFF) < (0x100 - EXPLOSION_SAVE_DISTANCE)
|
|
|
|
|| ((p->pos.y & 0xFF) < (0x100 - EXPLOSION_SAVE_DISTANCE)
|
|
|
|
&& (p->d == left || p->d == right))
|
|
|
|
&& (p->d == up || p->d == down)))
|
|
|
|
|| ((p->pos.y & 0xFF) < (0x100 - EXPLOSION_SAVE_DISTANCE)
|
|
|
|
if (!check_field (p->pos.x >> 8, p->pos.y >> 8))
|
|
|
|
&& (p->d == up || p->d == down)))
|
|
|
|
player_died (p, -1);
|
|
|
|
if (!check_field (p->pos.x >> 8, p->pos.y >> 8))
|
|
|
|
|
|
|
|
player_died (p, -1);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -485,7 +499,7 @@ get_player_on (short int x, short int y, int pl_nr[])
|
|
|
|
p;
|
|
|
|
p;
|
|
|
|
|
|
|
|
|
|
|
|
for (i = 0, p = 0; p < MAX_PLAYERS; p++)
|
|
|
|
for (i = 0, p = 0; p < MAX_PLAYERS; p++)
|
|
|
|
if (PS_IS_alife (bman.players[p].state)) {
|
|
|
|
if (PS_IS_alife (bman.players[p].state) && bman.players[p].tunnelto <= 0) {
|
|
|
|
if (bman.players[p].pos.x - EXPLOSION_SAVE_DISTANCE > x - 256
|
|
|
|
if (bman.players[p].pos.x - EXPLOSION_SAVE_DISTANCE > x - 256
|
|
|
|
&& bman.players[p].pos.x + EXPLOSION_SAVE_DISTANCE < x + 256
|
|
|
|
&& bman.players[p].pos.x + EXPLOSION_SAVE_DISTANCE < x + 256
|
|
|
|
&& bman.players[p].pos.y - EXPLOSION_SAVE_DISTANCE > y - 256
|
|
|
|
&& bman.players[p].pos.y - EXPLOSION_SAVE_DISTANCE > y - 256
|
|
|
|