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:
Lemon
2023-12-20 00:12:15 +01:00
committed by GitHub
parent ad3a2e99eb
commit 7c153416bc
20 changed files with 83 additions and 107 deletions

View File

@@ -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;