Fix usage of uninitialized waypoint array variables in ConfusedMovementGenerator<T>::Initialize and revert 9b1c565510+ad8ce5245e that covered up this problem without fixing it and introduced a faulty LOS calculation.

With thanks to Lynx3d and click, and Aokromes and ritchy for testing.

--HG--
branch : trunk
This commit is contained in:
Machiavelli committed 2010-06-19 17:26:12 +02:00
1 parent 706c0568a5
commit 8c8986b2bc
4 files changed
+17 -31

No files matched your search

@@ -109,7 +109,7 @@ namespace VMAP
ss2 >> map_num;
if (map_num >= 0)
{
std::cout << "ingoring Map " << map_num << " for VMaps\n";
sLog.outDebug("Ignoring Map %i for VMaps", map_num);
iIgnoreMapIds[map_num] = true;
// unload map in case it is loaded
unloadMap(map_num);
@@ -299,11 +299,11 @@ namespace VMAP
WorldModel *worldmodel = new WorldModel();
if (!worldmodel->readFile(basepath + filename + ".vmo"))
{
std::cout << "VMapManager2: could not load '" << basepath << filename << ".vmo'!\n";
sLog.outError("VMapManager2: could not load '%s%s.vmo'!", basepath, filename);
delete worldmodel;
return NULL;
}
std::cout << "VMapManager2: loading file '" << basepath << filename << "'.\n";
sLog.outDebug("VMapManager2: loading file '%s%s'.", basepath, filename);
model = iLoadedModelFiles.insert(std::pair<std::string, ManagedModel>(filename, ManagedModel())).first;
model->second.setModel(worldmodel);
}
@@ -316,12 +316,12 @@ namespace VMAP
ModelFileMap::iterator model = iLoadedModelFiles.find(filename);
if (model == iLoadedModelFiles.end())
{
std::cout << "VMapManager2: trying to unload non-loaded file '" << filename << "'!\n";
sLog.outError("VMapManager2: trying to unload non-loaded file '%s'!", filename);
return;
}
if( model->second.decRefCount() == 0)
{
std::cout << "VMapManager2: unloading file '" << filename << "'.\n";
sLog.outDebug("VMapManager2: unloading file '%s'", filename);
delete model->second.getModel();
iLoadedModelFiles.erase(model);
}