patch from Petr Gajdos...

origin
stpohle 19 years ago
parent e42c98da3d
commit 3869800d4b

@ -1,8 +1,15 @@
$Id: ChangeLog,v 1.119 2007/02/17 08:27:40 stpohle Exp $ $Id: ChangeLog,v 1.120 2007/03/14 17:49:10 stpohle Exp $
Version 0.11.7.1 Version 0.11.7.1
================ ================
- Fixed BUG shown in: http://bugzilla.novell.com/show_bug.cgi?id=242031
(patch from: Petr Gajdos)
In network game i wanted to use all the time a different bomb
instead of the first free aviable. In the code i forgot to modify
some values. This patch should fix it now.
(player.c:player_findfreebomb) changed i to nr.
- Fixed some drawing issues with flying bombs. - Fixed some drawing issues with flying bombs.
- The last special item use was lost on clients in a network game. - The last special item use was lost on clients in a network game.

@ -709,7 +709,7 @@ do_field (struct pkg_field *f_dat, _net_addr * addr)
if (f_dat->x < map.size.x && f_dat->y < map.size.y) { if (f_dat->x < map.size.x && f_dat->y < map.size.y) {
/* convert the fielddata */ /* convert the fielddata */
map.field[f_dat->x][f_dat->y].type = f_dat->type; map.field[f_dat->x][f_dat->y].type = f_dat->type; CHECK_BFIELD::: FOR BOMBS:::::
map.field[f_dat->x][f_dat->y].mixframe = f_dat->mixframe; map.field[f_dat->x][f_dat->y].mixframe = f_dat->mixframe;
map.field[f_dat->x][f_dat->y].special = f_dat->special; map.field[f_dat->x][f_dat->y].special = f_dat->special;
for (i = 0; i < 4; i++) { /* set the explosion field data */ for (i = 0; i < 4; i++) { /* set the explosion field data */

@ -1,4 +1,4 @@
/* $Id: player.c,v 1.104 2006/08/20 20:01:15 stpohle Exp $ /* $Id: player.c,v 1.105 2007/03/14 17:49:11 stpohle Exp $
* player.c - everything what have to do with the player */ * player.c - everything what have to do with the player */
#include <SDL.h> #include <SDL.h>
@ -873,7 +873,7 @@ player_findfreebomb (_player * player)
if (nr < 0 || nr >= MAX_BOMBS) // i out of range .. restart at bomb 0 if (nr < 0 || nr >= MAX_BOMBS) // i out of range .. restart at bomb 0
nr -= MAX_BOMBS; nr -= MAX_BOMBS;
if (player->bombs[i].state == BS_off) { /* check if this bomb is free */ if (player->bombs[nr].state == BS_off) { /* check if this bomb is free */
if (res == -1) if (res == -1)
res = i; res = i;
} }
@ -881,8 +881,8 @@ player_findfreebomb (_player * player)
bombused++; // count number of used bombs bombused++; // count number of used bombs
} }
if (res == -1 && i == player->bomb_lastex && player->bombs[i].state == BS_off) if (res == -1 && nr == player->bomb_lastex && player->bombs[nr].state == BS_off)
res = i; res = nr;
if (bombused >= player->bombs_n) if (bombused >= player->bombs_n)
res = -1; /* all max number of bombs lay */ res = -1; /* all max number of bombs lay */

Loading…
Cancel
Save