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:
hikerstk 2008-02-26 12:15:51 +00:00
parent 23076d39e8
commit 8e108ff600
3 changed files with 16 additions and 15 deletions

View File

@ -57,7 +57,7 @@ void KartProperties::load(const std::string filename, const std::string node,
try
{
lisp::Parser parser;
root = parser.parse(loader->getPath(filename));
root = parser.parse(filename);
const lisp::Lisp* const LISP = root->getLisp(node);
if(!LISP)

View File

@ -192,7 +192,8 @@ std::string Loader::getHomeDir() const
{
DIRNAME = ".";
}
DIRNAME += DIR_SEPARATOR+CONFIGDIR;
DIRNAME += DIR_SEPARATOR;
DIRNAME += CONFIGDIR;
#endif
return DIRNAME;
} // getHomeDir

View File

@ -43,10 +43,10 @@
#endif
const float Track::NOHIT = -99999.9f;
const int Track::QUAD_TRI_NONE = -1;
const int Track::QUAD_TRI_FIRST = 1;
const int Track::QUAD_TRI_SECOND = 2;
const int Track::UNKNOWN_SECTOR = -1;
const int Track::QUAD_TRI_NONE = -1;
const int Track::QUAD_TRI_FIRST = 1;
const int Track::QUAD_TRI_SECOND = 2;
const int Track::UNKNOWN_SECTOR = -1;
// ----------------------------------------------------------------------------
Track::Track( std::string filename_, float w, float h, bool stretch )
@ -263,14 +263,14 @@ int Track::findOutOfRoadSector
{
int sector = UNKNOWN_SECTOR;
float dist;
//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
//function will return UNKNOWN_SECTOR, and if the AI get this, it will
//trigger an assertion. I increased the nearest_dist default value from
//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
//find a better way of handling the shortcuts, and maybe a better way of
//calculating the distance.
//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
//function will return UNKNOWN_SECTOR, and if the AI get this, it will
//trigger an assertion. I increased the nearest_dist default value from
//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
//find a better way of handling the shortcuts, and maybe a better way of
//calculating the distance.
float nearest_dist = 9999999;
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 );
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");
if(!LISP)