Last Changes for smooth bomb pushing.. some clean up in the source

origin
stpohle 23 years ago
parent 1d4815d99d
commit 94670e1fdf

@ -27,8 +27,8 @@
#define SPECIAL_DESTROY_NUMUSE 5
#define SPECIAL_8WAY_NUMUSE 10
#define START_BOMBS 5
#define START_RANGE 6
#define START_BOMBS 1
#define START_RANGE 2
#define START_SPEED 16
#define SPEEDMUL 1.2

@ -111,7 +111,7 @@ bomb_move (_bomb * bomb)
else {
dy = bomb->moveto.y - bomb->pos.y; //move bomb to field
}
d_printf("move bomb %d %d\n",dx,dy);
if (!dx && !dy) { // bomb has reached its final position
bomb->moves = 0;
return;
@ -124,7 +124,7 @@ bomb_move (_bomb * bomb)
}
npos.x=bomb->pos.x+dx;
npos.y=bomb->pos.y+dy;
d_printf("move bomb %d %d\n",dx,dy);
// check if field is used
/*
if (!(dx && dy)) {
@ -343,7 +343,7 @@ explosion_check_field (int x, int y, int p, int b)
_bomb *bomb = &bman.players[p].bombs[b];
int pl[MAX_PLAYERS];
int i;
_point bo[MAX_PLAYERS * MAX_BOMBS], pos;
_point bo[MAX_PLAYERS * MAX_BOMBS];
_bomb *tmpbomb;
_player *tmpplayer;

@ -619,13 +619,15 @@ do_bombdata (struct pkg_bombdata *b_dat, _net_addr * addr)
bomb->r = b_dat->r;
bomb->ex_nr = b_dat->ex_nr;
bomb->state = b_dat->state;
bomb->moves = b_dat->moves;
bomb->moveto.x = b_dat->movetox;
bomb->moveto.y = b_dat->movetoy;
if (bomb->state == BS_exploding)
bomb_explode (b_dat->p_nr, b_dat->b_nr, 0);
if (bomb->ex_nr > bman.last_ex_nr)
bman.last_ex_nr = bomb->ex_nr;
};
@ -645,6 +647,9 @@ send_bombdata (_net_addr * addr, int p, int b, _bomb * bomb)
b_dat.b_nr = b;
b_dat.p_nr = p;
b_dat.h.flags = PKGF_ackreq;
b_dat.moves = bomb->moves;
b_dat.movetox = bomb->moveto.x;
b_dat.movetoy = bomb->moveto.y;
send_pkg ((struct pkg *) &b_dat, addr);
};

@ -150,6 +150,9 @@ struct pkg_bombdata {
unsigned char r;
int ex_nr;
int to;
unsigned short int movetox;
unsigned short int movetoy;
signed short int moves;
};

Loading…
Cancel
Save