Improved randomness (part 1) (#7882)
Faster and with no module bias Removed rnd_init, rnd_uint32 and rnd_uniform From now on we will only use rnd_value(min, max) for values in range [min, max] and rnd_chance(chance, base) for chances Fixes #7881 Fixes #7883 Fixes #7884 Fixes #7885 Co-authored-by: Lemongrass3110 <lemongrass@kstp.at>
This commit is contained in:
@@ -106,7 +106,7 @@ int path_blownpos(int16 m,int16 x0,int16 y0,int16 dx,int16 dy,int count)
|
||||
int fy = ( dy != 0 && map_getcellp(mapdata,x0,y0+dy,CELL_CHKPASS) );
|
||||
if( fx && fy )
|
||||
{
|
||||
if(rnd()&1)
|
||||
if(rnd_chance(50, 100))
|
||||
dx=0;
|
||||
else
|
||||
dy=0;
|
||||
|
||||
Reference in New Issue
Block a user