Ver a proveniência

Corrected function bug

pull/2/head
raysan5 há 11 anos
ascendente
cometimento
762befb967
1 ficheiros alterados com 8 adições e 1 eliminações
  1. +8
    -1
      src/core.c

+ 8
- 1
src/core.c Ver ficheiro

@ -344,7 +344,14 @@ int GetHexValue(Color color)
// Returns a random value between min and max (both included) // Returns a random value between min and max (both included)
int GetRandomValue(int min, int max) int GetRandomValue(int min, int max)
{ {
return (rand()%(abs(max-min)+1) - abs(min));
if (min > max)
{
int tmp = max;
max = min;
min = tmp;
}
return (rand()%(abs(max-min)+1) + min);
} }
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------

Carregando…
Cancelar
Guardar