fix GfParmGetNum: bad handle ((nil))

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7050 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 46191145974bfed9753c6361517313219514da6a
Former-commit-id: d7ca5e1ead8ebe881fb86ef088288ad335c92e9a
This commit is contained in:
iobyte 2020-05-16 06:31:13 +00:00
parent 595f0223ff
commit 529a6f14b9
3 changed files with 16 additions and 4 deletions

View file

@ -19,6 +19,10 @@
#include <fstream>
#include <iostream>
#include <tgf.h>
extern GfLogger* PLogUSR;
#define LogUSR (*PLogUSR)
MuFactors::MuFactors()
{
@ -48,7 +52,7 @@ void MuFactors::read(const std::string& datadir, const std::string& trackname)
mSect.push_back(sect);
mMinMuFactor = 1.0;
printMuFactors();
std::cout << "readMuFactors(): data file " << datFile << " not found, using default factor" << std::endl;
LogUSR.info("Couldn't load : %s, using default factor\n", datFile.c_str());
}
}

View file

@ -18,7 +18,10 @@
#include "PathMargins.h"
#include <fstream>
#include <iostream>
#include <tgf.h>
extern GfLogger* PLogUSR;
#define LogUSR (*PLogUSR)
PathMargins::PathMargins()
{
@ -45,7 +48,7 @@ void PathMargins::read(const std::string &datafile)
sect.left = 1.2;
sect.right = 1.2;
mPathMargin.push_back(sect);
std::cout << "readPathMargins(): data file " << datafile << " not found, using default margins" << std::endl;
LogUSR.info("Couldn't load : %s, using default margins\n", datafile.c_str());
}
}

View file

@ -27,6 +27,7 @@ Pit::Pit() :
mTeamCar(NULL),
mPit(NULL),
mPitInfo(NULL),
mTiresChangeTime(30.0),
mMaxDamage(7000.0),
mMaxDamageDist(30000.0),
mPreEntryMargin(100.0)
@ -39,7 +40,11 @@ void Pit::init(const tTrack* track, const tSituation* situation, MyCar* car, int
void* handle = NULL;
std::string tmpstr = std::string(GetLocalDir()) + "config/raceman/endrace.xml";
handle = GfParmReadFile(tmpstr.c_str(), GFPARM_RMODE_STD);
mTiresChangeTime = GfParmGetNum(handle, "Race", "all tires change time", (char*)NULL, 30.0);
if (handle)
{
mTiresChangeTime = GfParmGetNum(handle, "Race", "all tires change time", (char*)NULL, 30.0);
GfParmReleaseHandle(handle);
}
if (pitdamage)
{