bomb position totally changed to 16 bit

origin
stpohle 23 years ago
parent d8f552fc76
commit 0f6d342198

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

Loading…
Cancel
Save