Fix implicit-int-float-conversion warning in bombs demo

This commit is contained in:
Maarten Bent
2020-08-01 11:40:20 +02:00
parent 3c368408fb
commit 81a5efb6ab

View File

@@ -64,7 +64,7 @@ bool BombsGame::Init(int aWidth, int aHeight, bool easyCorner)
{ {
for(y=0; y<m_height; y++) for(y=0; y<m_height; y++)
{ {
m_field[x+y*m_width] = ((float)rand()/RAND_MAX <PROB) m_field[x+y*m_width] = (rand()/(float)RAND_MAX <PROB)
? BG_HIDDEN | BG_BOMB ? BG_HIDDEN | BG_BOMB
: BG_HIDDEN; : BG_HIDDEN;
} }