mirror of
https://github.com/glest/glest-source.git
synced 2025-08-13 20:03:58 +02:00
- attempt to see if this makes stability better
This commit is contained in:
@@ -519,7 +519,7 @@ void Properties::setBool(const string &key, bool value){
|
||||
}
|
||||
|
||||
void Properties::setFloat(const string &key, float value){
|
||||
setString(key, floatToStr(value,10));
|
||||
setString(key, floatToStr(value,6));
|
||||
}
|
||||
|
||||
void Properties::setString(const string &key, const string &value){
|
||||
|
@@ -81,7 +81,7 @@ int RandomGen::randRange(int min, int max,string lastCaller) {
|
||||
|
||||
int diff= max-min;
|
||||
double numerator = static_cast<double>(diff + 1) * static_cast<double>(RandomGen::rand(lastCaller));
|
||||
int res= min + static_cast<int>(truncateDecimal<double>(numerator / static_cast<double>(m),10));
|
||||
int res= min + static_cast<int>(truncateDecimal<double>(numerator / static_cast<double>(m),6));
|
||||
if(res < min || res > max) {
|
||||
char szBuf[8096]="";
|
||||
snprintf(szBuf,8096,"In [%s::%s Line: %d] res < min || res > max, min = %d, max = %d, res = %d",__FILE__,__FUNCTION__,__LINE__,min,max,res);
|
||||
@@ -102,7 +102,7 @@ double RandomGen::randRange(double min, double max,string lastCaller) {
|
||||
|
||||
double rand01 = static_cast<double>(RandomGen::rand(lastCaller)) / (m-1);
|
||||
double res= min + (max - min) * rand01;
|
||||
res = truncateDecimal<double>(res,10);
|
||||
res = truncateDecimal<double>(res,6);
|
||||
|
||||
if(res < min || res > max) {
|
||||
char szBuf[8096]="";
|
||||
|
Reference in New Issue
Block a user