diff --git a/ChangeLog b/ChangeLog index d00fc1b..9eb8c60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ -$Id: ChangeLog,v 1.37 2003/08/10 15:10:19 stpohle Exp $ +$Id: ChangeLog,v 1.38 2003/08/24 20:18:06 stpohle Exp $ -- tunnels added +- added tunnels to the game so player can go through. + PKG_playermove changed and PGK_tunneldata added - the first music file added to the game made by Digital_D diff --git a/src/packets.c b/src/packets.c index 9bd41fe..2df50a7 100644 --- a/src/packets.c +++ b/src/packets.c @@ -515,6 +515,7 @@ send_playermove (_net_addr * addr, int p_nr, _player * pl) p_dat.d = pl->d; p_dat.p_nr = p_nr; p_dat.speed = pl->speed; + p_dat.tunnelto = pl->tunnelto; send_pkg ((struct pkg *) &p_dat, addr); }; @@ -577,6 +578,7 @@ do_playermove (struct pkg_playermove *p_dat, _net_addr * addr) pl->speed = p_dat->speed; pl->pos.x = p_dat->pos.x; pl->pos.y = p_dat->pos.y; + pl->tunnelto = p_dat->tunnelto; } diff --git a/src/packets.h b/src/packets.h index 79f89a8..956ee56 100644 --- a/src/packets.h +++ b/src/packets.h @@ -144,6 +144,7 @@ struct pkg_playermove { signed char m; signed char d; signed char speed; + short int tunnelto; _point pos; }; diff --git a/src/player.c b/src/player.c index 3d9a14f..1a52f8e 100644 --- a/src/player.c +++ b/src/player.c @@ -242,7 +242,6 @@ stepmove_player (int pl_nr) d; if (p->m == 1) { - fpos.x = p->pos.x >> 8; fpos.y = p->pos.y >> 8; _pos.x = p->pos.x & 255; @@ -319,6 +318,7 @@ stepmove_player (int pl_nr) _pos.x = p->pos.x & 255; _pos.y = p->pos.y & 255; + /* check if we can go though a tunnel */ 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", @@ -337,6 +337,7 @@ stepmove_player (int pl_nr) 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; + speed = p->speed; } } } @@ -380,8 +381,12 @@ move_player (int pl_nr) oldd = p->d; - if (p->tunnelto > 0) + if (p->tunnelto > 0) { p->tunnelto--; + p->m = 0; + if (p->tunnelto <= 0 && GT_MP_PTP) + net_game_send_playermove (bman.p_nr, 1); + } else { if (p->m) { player_animation (p);