From 8f1077cf3b5d7731d1c2bea51fd7ca8e774c6a85 Mon Sep 17 00:00:00 2001 From: stpohle Date: Thu, 22 Feb 2007 21:32:58 +0000 Subject: [PATCH] pushed bombs are not working right... --- include/packets.h | 12 ++++++------ src/bomb.c | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/include/packets.h b/include/packets.h index 6d79512..32406fc 100644 --- a/include/packets.h +++ b/include/packets.h @@ -1,4 +1,4 @@ -/* $Id: packets.h,v 1.36 2007/02/22 21:12:18 stpohle Exp $ +/* $Id: packets.h,v 1.37 2007/02/22 21:32:58 stpohle Exp $ * network packets.. */ #ifndef _PACKETS_H_ @@ -212,15 +212,15 @@ struct pkg_bombdata { struct pkgheader h; unsigned char p_nr; unsigned char b_nr; - Uint16 x; - Uint16 y; + Sint16 x; + Sint16 y; unsigned char state; unsigned char r; Sint32 ex_nr; Sint32 to; - Uint16 destx; - Uint16 desty; - Uint16 fdata; + Sint16 destx; + Sint16 desty; + Sint16 fdata; } __attribute__((packed)); struct pkg_quit { diff --git a/src/bomb.c b/src/bomb.c index 21855ce..fb1d7e3 100644 --- a/src/bomb.c +++ b/src/bomb.c @@ -1,4 +1,4 @@ -/* $Id: bomb.c,v 1.67 2007/01/12 22:42:31 stpohle Exp $ */ +/* $Id: bomb.c,v 1.68 2007/02/22 21:32:59 stpohle Exp $ */ /* everything what have to do with the bombs */ #include "bomberclone.h" @@ -131,15 +131,16 @@ void bomb_move (_bomb * bomb) { step = (timefactor * bomb->fdata); /* move the bomb to the new position */ - if (bomb->dest.x < 0) + if (bomb->dest.x < 0.5f) bomb->pos.x -= step; - else if (bomb->dest.x > 0) + else if (bomb->dest.x > 0.5f) bomb->pos.x += step; - else if (bomb->dest.y < 0) + else if (bomb->dest.y < 0.5f) bomb->pos.y -= step; - else if (bomb->dest.y > 0) + else if (bomb->dest.y > 0.5f) bomb->pos.y += step; - + // printf ("%2.3f,%2.3f\n", bomb->dest.x, bomb->dest.y); + /* if we are on a complete field, check if we can move to the next one */ if ((CUTINT (bomb->pos.x) == 0.0f) && (CUTINT (bomb->pos.y) == 0.0f)) { @@ -184,6 +185,7 @@ void bomb_move (_bomb * bomb) { i++; } while (b == -1 && i < MAX_BOMBS); + /* if the bomb from our player send the current data again.. */ if (b != -1) net_game_send_bomb (bman.p_nr, b); }