|
|
@ -210,9 +210,9 @@ check_field (short int fx, short int fy, _player * p)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
int
|
|
|
|
stepmove_player ()
|
|
|
|
stepmove_player (int pl_nr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_player *p = &bman.players[bman.p_nr];
|
|
|
|
_player *p = &bman.players[pl_nr];
|
|
|
|
int _x,
|
|
|
|
int _x,
|
|
|
|
_y,
|
|
|
|
_y,
|
|
|
|
dx = 0,
|
|
|
|
dx = 0,
|
|
|
@ -283,34 +283,34 @@ stepmove_player ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
void
|
|
|
|
move_player ()
|
|
|
|
move_player (int pl_nr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int oldd,
|
|
|
|
int oldd,
|
|
|
|
stepsleft,
|
|
|
|
stepsleft,
|
|
|
|
speed;
|
|
|
|
speed;
|
|
|
|
_player *p = &bman.players[bman.p_nr];
|
|
|
|
_player *p = &bman.players[pl_nr];
|
|
|
|
|
|
|
|
|
|
|
|
oldd = p->d;
|
|
|
|
oldd = p->d;
|
|
|
|
if (p->m) {
|
|
|
|
if (p->m) {
|
|
|
|
player_animation (p);
|
|
|
|
player_animation (p);
|
|
|
|
|
|
|
|
|
|
|
|
if ((stepsleft = stepmove_player ()) > 0) {
|
|
|
|
if ((stepsleft = stepmove_player (pl_nr)) > 0) {
|
|
|
|
/* save the speed and go the rest of the step */
|
|
|
|
/* save the speed and go the rest of the step */
|
|
|
|
p->d = oldd;
|
|
|
|
p->d = oldd;
|
|
|
|
speed = p->speed;
|
|
|
|
speed = p->speed;
|
|
|
|
p->speed = stepsleft;
|
|
|
|
p->speed = stepsleft;
|
|
|
|
stepmove_player ();
|
|
|
|
stepmove_player (pl_nr);
|
|
|
|
p->speed = speed;
|
|
|
|
p->speed = speed;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 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 (bman.p_nr, (p->old_m == 0));
|
|
|
|
net_game_send_playermove (pl_nr, (p->old_m == 0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 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)
|
|
|
|
net_game_send_playermove (bman.p_nr, 1);
|
|
|
|
net_game_send_playermove (pl_nr, 1);
|
|
|
|
|
|
|
|
|
|
|
|
p->old_m = p->m; // save the old state
|
|
|
|
p->old_m = p->m; // save the old state
|
|
|
|
p->m = 0;
|
|
|
|
p->m = 0;
|
|
|
@ -519,7 +519,7 @@ player_calcpos ()
|
|
|
|
oldd = pl->d;
|
|
|
|
oldd = pl->d;
|
|
|
|
|
|
|
|
|
|
|
|
if (pl->speed > 1)
|
|
|
|
if (pl->speed > 1)
|
|
|
|
stepmove_player ();
|
|
|
|
stepmove_player (p);
|
|
|
|
|
|
|
|
|
|
|
|
if (pl->speeddat) {
|
|
|
|
if (pl->speeddat) {
|
|
|
|
pl->m = oldm;
|
|
|
|
pl->m = oldm;
|
|
|
|