|
|
|
@ -57,8 +57,6 @@ bomb_explode (int p, int b, int net)
|
|
|
|
|
bomb->firer[d] = 0;
|
|
|
|
|
bomb->firerst[d] = -1;
|
|
|
|
|
}
|
|
|
|
|
bomb->pos.x=bomb->pos.x>>8;
|
|
|
|
|
bomb->pos.y=bomb->pos.y>>8;
|
|
|
|
|
|
|
|
|
|
if (GT_MP_PTPM && net) /* from now on only the server let the bomb explode */
|
|
|
|
|
net_game_send_bomb (p, b);
|
|
|
|
@ -180,7 +178,11 @@ restore_explosion (_bomb * bomb)
|
|
|
|
|
dy = 0;
|
|
|
|
|
int _x,
|
|
|
|
|
_y;
|
|
|
|
|
|
|
|
|
|
_point bpos;
|
|
|
|
|
|
|
|
|
|
bpos.x = bomb->pos.x >> 8;
|
|
|
|
|
bpos.y = bomb->pos.y >> 8;
|
|
|
|
|
|
|
|
|
|
for (d = 0; d < 4; d++) {
|
|
|
|
|
switch (d) {
|
|
|
|
|
case (left):
|
|
|
|
@ -201,8 +203,8 @@ restore_explosion (_bomb * bomb)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_x = bomb->pos.x;
|
|
|
|
|
_y = bomb->pos.y;
|
|
|
|
|
_x = bpos.x;
|
|
|
|
|
_y = bpos.y;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < bomb->firer[d]; i++) {
|
|
|
|
|
if (--bman.field[_x][_y].ex[d].count == 0) // there was only one explosion so
|
|
|
|
@ -237,15 +239,15 @@ restore_explosion (_bomb * bomb)
|
|
|
|
|
net_game_send_field (_x, _y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_x = bomb->pos.x;
|
|
|
|
|
_y = bomb->pos.y;
|
|
|
|
|
_x = bpos.x;
|
|
|
|
|
_y = bpos.y;
|
|
|
|
|
gfx_AddUpdateRect (gfx.offset.x + (_x - bomb->firer[left]) * gfx.block.x,
|
|
|
|
|
gfx.offset.y + (_y - bomb->firer[up]) * gfx.block.y,
|
|
|
|
|
gfx.block.x * (bomb->firer[left] + bomb->firer[right] + 1),
|
|
|
|
|
gfx.block.x * (bomb->firer[up] + bomb->firer[down] + 1));
|
|
|
|
|
|
|
|
|
|
/* delete field from the bfield map */
|
|
|
|
|
bman.bfield[bomb->pos.x ][bomb->pos.y] = 0;
|
|
|
|
|
bman.bfield[bpos.x ][bpos.y] = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -310,8 +312,11 @@ draw_explosion (_bomb * bomb)
|
|
|
|
|
r,
|
|
|
|
|
dx,
|
|
|
|
|
dy;
|
|
|
|
|
_point p;
|
|
|
|
|
_point p, bpos;
|
|
|
|
|
|
|
|
|
|
bpos.x = bomb->pos.x >> 8;
|
|
|
|
|
bpos.y = bomb->pos.y >> 8;
|
|
|
|
|
|
|
|
|
|
bomb->frameto--;
|
|
|
|
|
if (bomb->frameto < 0 || bomb->frameto > ANI_FIRETIMEOUT)
|
|
|
|
|
bomb->frameto = ANI_FIRETIMEOUT;
|
|
|
|
@ -335,8 +340,8 @@ draw_explosion (_bomb * bomb)
|
|
|
|
|
dy = 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
p.x = bomb->pos.x;
|
|
|
|
|
p.y = bomb->pos.y;
|
|
|
|
|
p.x = bpos.x;
|
|
|
|
|
p.y = bpos.y;
|
|
|
|
|
|
|
|
|
|
for (r = 0; r < bomb->firer[d]; r++) {
|
|
|
|
|
if (bomb->frameto == 0) {
|
|
|
|
@ -359,7 +364,11 @@ do_explosion (int p, int b)
|
|
|
|
|
int dx = 0,
|
|
|
|
|
dy = 0,
|
|
|
|
|
d;
|
|
|
|
|
|
|
|
|
|
_point bpos;
|
|
|
|
|
|
|
|
|
|
bpos.x = bomb->pos.x >> 8;
|
|
|
|
|
bpos.y = bomb->pos.y >> 8;
|
|
|
|
|
|
|
|
|
|
for (d = 0; d < 4; d++) {
|
|
|
|
|
switch (d) {
|
|
|
|
|
case (left):
|
|
|
|
@ -384,17 +393,17 @@ do_explosion (int p, int b)
|
|
|
|
|
dx = bomb->firer[d] * dx;
|
|
|
|
|
dy = bomb->firer[d] * dy;
|
|
|
|
|
|
|
|
|
|
if (explosion_check_field (bomb->pos.x + dx, bomb->pos.y + dy, p, b) ==
|
|
|
|
|
if (explosion_check_field (bpos.x + dx, bpos.y + dy, p, b) ==
|
|
|
|
|
BS_off && bomb->firerst[d] == -1) {
|
|
|
|
|
bomb->firer[d]++;
|
|
|
|
|
bman.field[bomb->pos.x + dx][bomb->pos.y + dy].ex[d].count++;
|
|
|
|
|
bman.field[bomb->pos.x + dx][bomb->pos.y + dy].ex[d].frame = bomb->firer[d];
|
|
|
|
|
bman.field[bpos.x + dx][bpos.y + dy].ex[d].count++;
|
|
|
|
|
bman.field[bpos.x + dx][bpos.y + dy].ex[d].frame = bomb->firer[d];
|
|
|
|
|
/* if we have a slow pc we can enable this and disable the drawing animation */
|
|
|
|
|
// draw_fire (bomb->pos.x + dx, bomb->pos.y + dy, d, gfx.fire.frames>>1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
bomb->firerst[d] = bomb->firer[d];
|
|
|
|
|
draw_stone (bomb->pos.x + dx, bomb->pos.y + dy);
|
|
|
|
|
draw_stone (bpos.x + dx, bpos.y + dy);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|