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;
|
||||
}
|
||||
|
||||
#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)
|
||||
{
|
||||
// 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
|
||||
{
|
||||
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;
|
||||
static Array <DirectoryTransition> directories;
|
||||
|
||||
directories.Push (DirectoryTransition ("wptdefault", "data"));
|
||||
directories.Push (DirectoryTransition ("data/data", "data/learned"));
|
||||
|
|
|
|||
|
|
@ -957,7 +957,7 @@ void Waypoint::SaveVisibilityTab (void)
|
|||
return;
|
||||
|
||||
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;
|
||||
|
||||
|
|
@ -972,7 +972,7 @@ void Waypoint::SaveVisibilityTab (void)
|
|||
|
||||
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;
|
||||
}
|
||||
fp.Close ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue