fixed some typos in waypoint.cpp
fixed clang build error.
This commit is contained in:
parent
0ff1caf5b9
commit
5291216d06
2 changed files with 30 additions and 30 deletions
|
|
@ -2989,38 +2989,38 @@ export void Meta_Init (void)
|
||||||
g_isMetamod = true;
|
g_isMetamod = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <io.h>
|
extern "C" int access (const char *filename, int mode);
|
||||||
|
|
||||||
|
struct DirectoryTransition
|
||||||
|
{
|
||||||
|
String oldName;
|
||||||
|
String newName;
|
||||||
|
|
||||||
|
DirectoryTransition (void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
DirectoryTransition (const String &oldName, const String &newName)
|
||||||
|
{
|
||||||
|
String rootPath;
|
||||||
|
rootPath->AssignFormat ("%s/addons/yapb/", GetModName ());
|
||||||
|
|
||||||
|
this->oldName = rootPath + oldName;
|
||||||
|
this->newName = rootPath + newName;
|
||||||
|
}
|
||||||
|
|
||||||
|
void TryToRename (void)
|
||||||
|
{
|
||||||
|
if (access (oldName->GetBuffer (), 00) != -1)
|
||||||
|
rename (oldName->GetBuffer (), newName->GetBuffer ());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void FixDirectoryStructure (void)
|
void FixDirectoryStructure (void)
|
||||||
{
|
{
|
||||||
// temporary function for 2.7 directory structure changes, will be delete after final releases of the bot
|
// temporary function for 2.7 directory structure changes, will be deleted after final releases of the bot
|
||||||
|
|
||||||
struct DirectoryTransition
|
static Array <DirectoryTransition> directories;
|
||||||
{
|
|
||||||
String oldName;
|
|
||||||
String newName;
|
|
||||||
|
|
||||||
DirectoryTransition (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
DirectoryTransition (const String &oldName, const String &newName)
|
|
||||||
{
|
|
||||||
String rootPath;
|
|
||||||
rootPath->AssignFormat ("%s/addons/yapb/", GetModName ());
|
|
||||||
|
|
||||||
this->oldName = rootPath + oldName;
|
|
||||||
this->newName = rootPath + newName;
|
|
||||||
}
|
|
||||||
|
|
||||||
void TryToRename (void)
|
|
||||||
{
|
|
||||||
if (access (oldName->GetBuffer (), 00) != -1)
|
|
||||||
rename (oldName->GetBuffer (), newName->GetBuffer ());
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
Array <DirectoryTransition> directories;
|
|
||||||
|
|
||||||
directories.Push (DirectoryTransition ("wptdefault", "data"));
|
directories.Push (DirectoryTransition ("wptdefault", "data"));
|
||||||
directories.Push (DirectoryTransition ("data/data", "data/learned"));
|
directories.Push (DirectoryTransition ("data/data", "data/learned"));
|
||||||
|
|
|
||||||
|
|
@ -957,7 +957,7 @@ void Waypoint::SaveVisibilityTab (void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_visLUT == NULL)
|
if (m_visLUT == NULL)
|
||||||
AddLogEntry (true, LL_FATAL, "Can't save visiblity tab. Bad data.");
|
AddLogEntry (true, LL_FATAL, "Can't save visibility tab. Bad data.");
|
||||||
|
|
||||||
ExtensionHeader header;
|
ExtensionHeader header;
|
||||||
|
|
||||||
|
|
@ -972,7 +972,7 @@ void Waypoint::SaveVisibilityTab (void)
|
||||||
|
|
||||||
if (!fp.IsValid ())
|
if (!fp.IsValid ())
|
||||||
{
|
{
|
||||||
AddLogEntry (true, LL_ERROR, "Failed to open visiblity table for writing");
|
AddLogEntry (true, LL_ERROR, "Failed to open visibility table for writing");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fp.Close ();
|
fp.Close ();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue