*Update to Mangos 6902. Source: Mangos.

*Skipped rev: rev 6893, some code about waypoint movement.

--HG--
branch : trunk
This commit is contained in:
megamage
2008-12-12 11:21:28 -06:00
parent 135f39a5ef
commit b6c288ca9f
84 changed files with 785 additions and 705 deletions

View File

@@ -277,10 +277,8 @@ namespace VMAP
{
dirFileName = getDirFileName(pMapId);
}
size_t len = pBasePath.length() + dirFileName.length();
char *filenameBuffer = new char[len+1];
sprintf(filenameBuffer, "%s%s", pBasePath.c_str(), dirFileName.c_str());
FILE* df = fopen(filenameBuffer, "rb");
std::string fb = pBasePath + dirFileName;
FILE* df = fopen(fb.c_str(), "rb");
if(df)
{
char lineBuffer[FILENAMEBUFFER_SIZE];
@@ -290,8 +288,8 @@ namespace VMAP
chomp(name);
if(name.length() >1)
{
sprintf(filenameBuffer, "%s%s", pBasePath.c_str(), name.c_str());
FILE* df2 = fopen(filenameBuffer, "rb");
std::string fb2 = pBasePath + name;
FILE* df2 = fopen(fb2.c_str(), "rb");
if(df2)
{
char magic[8];
@@ -304,7 +302,6 @@ namespace VMAP
}
fclose(df);
}
delete[] filenameBuffer;
return result;
}
@@ -661,14 +658,12 @@ namespace VMAP
bool MapTree::loadMap(const std::string& pDirFileName, unsigned int pMapTileIdent)
{
bool result = true;
size_t len = iBasePath.length() + pDirFileName.length();
char *filenameBuffer = new char[len+1];
if(!hasDirFile(pDirFileName))
{
FilesInDir filesInDir;
result = false;
sprintf(filenameBuffer, "%s%s", iBasePath.c_str(), pDirFileName.c_str());
FILE* df = fopen(filenameBuffer, "rb");
std::string fb = iBasePath + pDirFileName;
FILE* df = fopen(fb.c_str(), "rb");
if(df)
{
char lineBuffer[FILENAMEBUFFER_SIZE];
@@ -728,7 +723,6 @@ namespace VMAP
filesInDir.incRefCount();
}
}
delete [] filenameBuffer;
return (result);
}