Lower rand() range in calc from 200k to 10k

Standard library implementation generates random number up to 32k anyway, plus 10k is sufficient anyway
Northspring 2014-08-21 16:10:34 +02:00
parent fe090a75b2
commit 685fff9850
4 changed files with 4 additions and 4 deletions

View File

@ -838,7 +838,7 @@ bool cmd_line_chat(const std::string& revised_text, EChatType type, bool from_ge
if (random_string_pos != std::string::npos)
{
S32 random_number = 0;
if (random_max > random_min && random_min >= -200000 && random_min <= 200000 && random_max >= -200000 && random_max <= 200000) // Generate a random number only when max > min, and when they're in rational range
if (random_max > random_min && random_min >= -10000 && random_min <= 10000 && random_max >= -10000 && random_max <= 10000) // Generate a random number only when max > min, and when they're in rational range
{
S32 random_calculated = (random_max - random_min) + 1;
if (random_calculated != 0) // Don't divide by zero

View File

@ -5718,7 +5718,7 @@ Setzen Sie den Editorpfad in Anführungszeichen
Es müssen positive Werte für Würfel (max. 100) und Seiten (max. 1000) angegeben werden.
</string>
<string name="FSCmdLineCalcRandError">
'[RAND]' ist kein gültiger Ausdruck für RAND(min,max). MAX muss größer als MIN sein und beide Werte müssen sich im Intervall von -200000 bis 200000 befinden.
'[RAND]' ist kein gültiger Ausdruck für RAND(min,max). MAX muss größer als MIN sein und beide Werte müssen sich im Intervall von -10000 bis 10000 befinden.
</string>
<string name="FSWithHavok">
mit Havok-Unterstützung

View File

@ -2597,7 +2597,7 @@ Try enclosing path to the editor with double quotes.
<string name="FSCmdLineRollDiceTotal">Total result for [DICE]d[FACES]: [RESULT].</string>
<string name="FSCmdLineRollDiceLimits">You must provide positive values for dice (max 100) and faces (max 1000).</string>
<string name="FSCmdLineCalcRandError">'[RAND]' is not a valid expression for RAND(min,max). MAX must be higher than MIN, both in -200000 - 200000 range.</string>
<string name="FSCmdLineCalcRandError">'[RAND]' is not a valid expression for RAND(min,max). MAX must be higher than MIN, both in range from -10000 to 10000.</string>
<!-- Build types for about floater -->
<string name="FSWithHavok">with Havok support</string>

View File

@ -5214,7 +5214,7 @@ Spróbuj załączyć ścieżkę do edytora w cytowaniu.
Musisz podać wartości dodatnie dla ilości kostek (maksymalnie 100) oraz ścianek (maksymalnie 1000).
</string>
<string name="FSCmdLineCalcRandError">
'[RAND]' nie jest poprawnym wyrażeniem dla RAND(min,max). MAX musi być większe niż MIN, oba w zakresie -200000 - 200000.
'[RAND]' nie jest poprawnym wyrażeniem dla RAND(min,max). MAX musi być większe niż MIN, oba w zakresie od -10000 do 10000.
</string>
<string name="FSWithHavok">
ze wsparciem dla Havoka