@ -1,4 +1,4 @@
/* $Id: flyingitems.c,v 1. 2 2004/01/26 05:39:3 8 stpohle Exp $ */
/* $Id: flyingitems.c,v 1. 3 2004/02/11 21:46:4 8 stpohle Exp $ */
# include "bomberclone.h"
# include "bomberclone.h"
# include "flyingitems.h"
# include "flyingitems.h"
@ -120,11 +120,12 @@ _point flitems_randompos (int p_nr) {
}
}
/* check if the field is good */
/* check if the field is good */
check = ( to . x > 0 & & to . y > 0 & & to . x < map . size . x - 1 & & to . y < map . size . y - 1 & &
check = ( to . x > 0 & & to . y > 0 & & to . x < map . size . x - 1 & & to . y < map . size . y - 1
flitems_checkfreepos ( to ) & &
& & flitems_checkfreepos ( to )
( map . field [ to . x ] [ to . y ] . type = = FT_nothing
& & ( map . field [ to . x ] [ to . y ] . type = = FT_nothing
| | ( map . field [ to . x ] [ to . y ] . type = = FT_stone & & map . field [ to . x ] [ to . y ] . special = = FT_nothing ) ) ) ;
| | ( map . field [ to . x ] [ to . y ] . type = = FT_stone & & map . field [ to . x ] [ to . y ] . special = = FT_nothing ) )
} while ( ! check & & maxtry > 200 ) ;
& & map . bfield [ to . x ] [ to . y ] = = 0 ) ;
} while ( ! check & & maxtry < 200 ) ;
if ( ! check ) {
if ( ! check ) {
to . x = - 1 ;
to . x = - 1 ;
@ -146,18 +147,24 @@ void flitems_dropitems (int p_nr, _pointf from, int cnt_speed, int cnt_bombs, in
to = flitems_randompos ( p_nr ) ;
to = flitems_randompos ( p_nr ) ;
if ( to . x ! = - 1 )
if ( to . x ! = - 1 )
fiptr [ lpos + + ] = flitems_additem ( from , to , FT_shoe ) ;
fiptr [ lpos + + ] = flitems_additem ( from , to , FT_shoe ) ;
else
d_printf ( " flitems_dropitems: (FT_shoe) item could not been set \n " ) ;
}
}
for ( i = 0 ; i < cnt_bombs ; i + + ) {
for ( i = 0 ; i < cnt_bombs ; i + + ) {
to = flitems_randompos ( p_nr ) ;
to = flitems_randompos ( p_nr ) ;
if ( to . x ! = - 1 )
if ( to . x ! = - 1 )
fiptr [ lpos + + ] = flitems_additem ( from , to , FT_bomb ) ;
fiptr [ lpos + + ] = flitems_additem ( from , to , FT_bomb ) ;
else
d_printf ( " flitems_dropitems: (FT_bomb) item could not been set \n " ) ;
}
}
for ( i = 0 ; i < cnt_range ; i + + ) {
for ( i = 0 ; i < cnt_range ; i + + ) {
to = flitems_randompos ( p_nr ) ;
to = flitems_randompos ( p_nr ) ;
if ( to . x ! = - 1 )
if ( to . x ! = - 1 )
fiptr [ lpos + + ] = flitems_additem ( from , to , FT_fire ) ;
fiptr [ lpos + + ] = flitems_additem ( from , to , FT_fire ) ;
else
d_printf ( " flitems_dropitems: (FT_fire) item could not been set \n " ) ;
}
}
fiptr [ lpos ] = NULL ;
fiptr [ lpos ] = NULL ;