From cd0af836edfa821bcffce2025342ca26db02610a Mon Sep 17 00:00:00 2001 From: stpohle Date: Sat, 12 Jul 2003 23:55:07 +0000 Subject: [PATCH] pushung bomb and wrong direction illness bug fixed --- ChangeLog | 2 ++ TODO | 1 - src/bomberclone.h | 6 ++++-- src/game.c | 1 + src/player.c | 1 + src/special.c | 44 ++++++++++++++++++++++++-------------------- 6 files changed, 32 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09e01c7..1bc4097 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ Version 0.9.9 ============= fix2 +- pushing bombs and wrong directin illness + - fixed: remove network flag from disconected players so we won't send data to players in the game which have already disconnected diff --git a/TODO b/TODO index 1633f3d..da2d966 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,6 @@ this version (fix2): ==================== -- pushing bombs and wrong directin illness - special trigger bomb over.. all trigger bombs have to be to normal bombs. diff --git a/src/bomberclone.h b/src/bomberclone.h index 5667ea9..3cd0e3d 100644 --- a/src/bomberclone.h +++ b/src/bomberclone.h @@ -1,4 +1,4 @@ -/* $Id: bomberclone.h,v 1.40 2003/06/22 02:03:09 stpohle Exp $ */ +/* $Id: bomberclone.h,v 1.41 2003/07/12 23:55:08 stpohle Exp $ */ /* bomberclone.h */ #ifndef _BOMBERCLONE_H_ @@ -71,6 +71,8 @@ struct __special { int type; // type of the special int to; // timeout int numuse; // num of uses left + int use; /* currently used set by special_use + and deleted in special_loop */ } typedef _special; struct __player { @@ -97,7 +99,7 @@ struct __player { int speed; // how fast we can go (0 = slow, 1 = normal... 3 = fastest) int speeddat; // some data i need to do the speed thing _playerilness ill[PI_max]; // all possible types - _special special; // special the player has + _special special; // special the player has char name[LEN_PLAYERNAME]; // name oder name[0] == 0 unsigned char state; // status of the player diff --git a/src/game.c b/src/game.c index 5f65b41..1313e67 100644 --- a/src/game.c +++ b/src/game.c @@ -203,6 +203,7 @@ game_loop () dead_playerani (); player_ilness_loop (bman.p_nr); special_loop(bman.p_nr); + if ((bman.players[bman.p_nr].state & PSFM_alife) == PSFM_alife) move_player (bman.p_nr); diff --git a/src/player.c b/src/player.c index 834272f..5030df9 100644 --- a/src/player.c +++ b/src/player.c @@ -674,6 +674,7 @@ player_set_ilness (_player * p, int t) type = s_random (PI_max); else type = t; + d_printf ("Ilness : %d\n", type); switch (type) { case PI_slow: diff --git a/src/special.c b/src/special.c index 3735f1d..4ba9612 100644 --- a/src/special.c +++ b/src/special.c @@ -158,7 +158,7 @@ void special_pickup (int p_nr, int s_nr) { _special *s = &bman.players[p_nr].special; - + s->to = 0; s->numuse = 0; s->type = s_nr; @@ -174,7 +174,7 @@ special_pickup (int p_nr, int s_nr) s->to = SPECIAL_PUSH_TIME * TIME_FACTOR; break; } - + bman.updatestatusbar = 1; } @@ -191,34 +191,38 @@ special_loop (int p_nr) { _special *s = &bman.players[p_nr].special; + if (s->use) { + switch (bman.players[p_nr].special.type) { + case SP_trigger: + special_trigger (p_nr); + break; + case SP_row: + if (bman.players[p_nr].m) + special_row (p_nr); + break; + case SP_push: + if (bman.players[p_nr].m) + special_push (p_nr); + break; + case SP_kick: + break; + } + s->use = 0; + } + if (!s->type) return; if (s->to) { - s->to--; + s->to--; if (!s->to) special_clear (p_nr); - } + } } void special_use (int p_nr) { - - switch (bman.players[p_nr].special.type) { - case SP_trigger: - special_trigger (p_nr); - break; - case SP_row: - if (bman.players[p_nr].m) - special_row (p_nr); - break; - case SP_push: - if (bman.players[p_nr].m) - special_push (p_nr); - break; - case SP_kick: - break; - } + bman.players[p_nr].special.use = 1; }