Bugifxes for new loader (when STK was not started in root
directorym files were not found). git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1597 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
23076d39e8
commit
8e108ff600
@ -57,7 +57,7 @@ void KartProperties::load(const std::string filename, const std::string node,
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
lisp::Parser parser;
|
lisp::Parser parser;
|
||||||
root = parser.parse(loader->getPath(filename));
|
root = parser.parse(filename);
|
||||||
|
|
||||||
const lisp::Lisp* const LISP = root->getLisp(node);
|
const lisp::Lisp* const LISP = root->getLisp(node);
|
||||||
if(!LISP)
|
if(!LISP)
|
||||||
|
@ -192,7 +192,8 @@ std::string Loader::getHomeDir() const
|
|||||||
{
|
{
|
||||||
DIRNAME = ".";
|
DIRNAME = ".";
|
||||||
}
|
}
|
||||||
DIRNAME += DIR_SEPARATOR+CONFIGDIR;
|
DIRNAME += DIR_SEPARATOR;
|
||||||
|
DIRNAME += CONFIGDIR;
|
||||||
#endif
|
#endif
|
||||||
return DIRNAME;
|
return DIRNAME;
|
||||||
} // getHomeDir
|
} // getHomeDir
|
||||||
|
@ -43,10 +43,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const float Track::NOHIT = -99999.9f;
|
const float Track::NOHIT = -99999.9f;
|
||||||
const int Track::QUAD_TRI_NONE = -1;
|
const int Track::QUAD_TRI_NONE = -1;
|
||||||
const int Track::QUAD_TRI_FIRST = 1;
|
const int Track::QUAD_TRI_FIRST = 1;
|
||||||
const int Track::QUAD_TRI_SECOND = 2;
|
const int Track::QUAD_TRI_SECOND = 2;
|
||||||
const int Track::UNKNOWN_SECTOR = -1;
|
const int Track::UNKNOWN_SECTOR = -1;
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
Track::Track( std::string filename_, float w, float h, bool stretch )
|
Track::Track( std::string filename_, float w, float h, bool stretch )
|
||||||
@ -263,14 +263,14 @@ int Track::findOutOfRoadSector
|
|||||||
{
|
{
|
||||||
int sector = UNKNOWN_SECTOR;
|
int sector = UNKNOWN_SECTOR;
|
||||||
float dist;
|
float dist;
|
||||||
//FIXME: it can happen that dist is bigger than nearest_dist for all the
|
//FIXME: it can happen that dist is bigger than nearest_dist for all the
|
||||||
//the points we check (currently a limit of +/- 10), and if so, the
|
//the points we check (currently a limit of +/- 10), and if so, the
|
||||||
//function will return UNKNOWN_SECTOR, and if the AI get this, it will
|
//function will return UNKNOWN_SECTOR, and if the AI get this, it will
|
||||||
//trigger an assertion. I increased the nearest_dist default value from
|
//trigger an assertion. I increased the nearest_dist default value from
|
||||||
//99999 to 9999999, which is a lot more than the situation that caused
|
//99999 to 9999999, which is a lot more than the situation that caused
|
||||||
//the discovery of this problem, but the best way to solve this, is to
|
//the discovery of this problem, but the best way to solve this, is to
|
||||||
//find a better way of handling the shortcuts, and maybe a better way of
|
//find a better way of handling the shortcuts, and maybe a better way of
|
||||||
//calculating the distance.
|
//calculating the distance.
|
||||||
float nearest_dist = 9999999;
|
float nearest_dist = 9999999;
|
||||||
const unsigned int DRIVELINE_SIZE = (unsigned int)m_left_driveline.size();
|
const unsigned int DRIVELINE_SIZE = (unsigned int)m_left_driveline.size();
|
||||||
|
|
||||||
@ -792,7 +792,7 @@ void Track::loadTrack(std::string filename_)
|
|||||||
sgSetVec4 ( m_diffuse_col, 1.0f, 1.0f, 1.0f, 1.0f );
|
sgSetVec4 ( m_diffuse_col, 1.0f, 1.0f, 1.0f, 1.0f );
|
||||||
|
|
||||||
lisp::Parser parser;
|
lisp::Parser parser;
|
||||||
const lisp::Lisp* const ROOT = parser.parse(loader->getPath(m_filename));
|
const lisp::Lisp* const ROOT = parser.parse(m_filename);
|
||||||
|
|
||||||
const lisp::Lisp* const LISP = ROOT->getLisp("tuxkart-track");
|
const lisp::Lisp* const LISP = ROOT->getLisp("tuxkart-track");
|
||||||
if(!LISP)
|
if(!LISP)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user