Fix code analysis warnings
This commit is contained in:
parent
4cb707d43d
commit
e94d9788d0
@ -163,7 +163,6 @@ namespace Components
|
|||||||
|
|
||||||
if ((Game::Sys_Milliseconds() - lastCheck) > 1000 * 70)
|
if ((Game::Sys_Milliseconds() - lastCheck) > 1000 * 70)
|
||||||
{
|
{
|
||||||
// TODO: Move that elsewhere
|
|
||||||
if (HANDLE h = OpenProcess(PROCESS_VM_READ, TRUE, GetCurrentProcessId()))
|
if (HANDLE h = OpenProcess(PROCESS_VM_READ, TRUE, GetCurrentProcessId()))
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_DETECTIONS
|
#ifdef DEBUG_DETECTIONS
|
||||||
|
@ -5,7 +5,7 @@ namespace Assets
|
|||||||
void IGfxImage::Load(Game::XAssetHeader* header, std::string name, Components::ZoneBuilder::Zone* builder)
|
void IGfxImage::Load(Game::XAssetHeader* header, std::string name, Components::ZoneBuilder::Zone* builder)
|
||||||
{
|
{
|
||||||
Game::GfxImage* image = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_IMAGE, name.data()).image;
|
Game::GfxImage* image = Game::DB_FindXAssetHeader(Game::XAssetType::ASSET_TYPE_IMAGE, name.data()).image;
|
||||||
if (image) return; // TODO: Check for default?
|
if (image) return;
|
||||||
|
|
||||||
image = builder->GetAllocator()->Allocate<Game::GfxImage>();
|
image = builder->GetAllocator()->Allocate<Game::GfxImage>();
|
||||||
if (!image)
|
if (!image)
|
||||||
|
@ -13,8 +13,6 @@ namespace Assets
|
|||||||
|
|
||||||
buffer->PushBlock(Game::XFILE_BLOCK_VIRTUAL);
|
buffer->PushBlock(Game::XFILE_BLOCK_VIRTUAL);
|
||||||
|
|
||||||
// TODO: I think we have to write them, even if they are NULL
|
|
||||||
|
|
||||||
if (asset->name)
|
if (asset->name)
|
||||||
{
|
{
|
||||||
buffer->SaveString(builder->GetAssetName(this->GetType(), asset->name));
|
buffer->SaveString(builder->GetAssetName(this->GetType(), asset->name));
|
||||||
|
@ -110,7 +110,6 @@ namespace Components
|
|||||||
{
|
{
|
||||||
Bans::AccessMutex.lock();
|
Bans::AccessMutex.lock();
|
||||||
|
|
||||||
// TODO: Read bans
|
|
||||||
FileSystem::File bans("bans.json");
|
FileSystem::File bans("bans.json");
|
||||||
|
|
||||||
if (bans.Exists())
|
if (bans.Exists())
|
||||||
|
@ -542,13 +542,6 @@ namespace Components
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Utils::Hook(0x5AC6E9, [] ()
|
|
||||||
// {
|
|
||||||
// // TODO: Perform moddownload here
|
|
||||||
//
|
|
||||||
// Game::CL_DownloadsComplete(0);
|
|
||||||
// }, HOOK_CALL).Install()->Quick();
|
|
||||||
|
|
||||||
QuickPatch::OnFrame([]
|
QuickPatch::OnFrame([]
|
||||||
{
|
{
|
||||||
if (Download::CLDownload.Running)
|
if (Download::CLDownload.Running)
|
||||||
|
@ -155,7 +155,6 @@ namespace Components
|
|||||||
Localization::Set("MPUI_MOTD_TEXT", data);
|
Localization::Set("MPUI_MOTD_TEXT", data);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Implement update checks here!
|
|
||||||
if (!Loader::PerformingUnitTests())
|
if (!Loader::PerformingUnitTests())
|
||||||
{
|
{
|
||||||
while (!News::Terminate)
|
while (!News::Terminate)
|
||||||
|
@ -768,11 +768,6 @@ namespace Components
|
|||||||
Node::AddNode(address);
|
Node::AddNode(address);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// TODO: Implement client handshake stuff
|
|
||||||
// Nvm, clients can simply ignore that i guess
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Command::Add("listnodes", [] (Command::Params)
|
Command::Add("listnodes", [] (Command::Params)
|
||||||
|
@ -45,7 +45,6 @@ namespace Components
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Maybe execute that for clients as well, when we use triangular natting.
|
|
||||||
if (!Dedicated::IsEnabled()) return;
|
if (!Dedicated::IsEnabled()) return;
|
||||||
|
|
||||||
// Load public key
|
// Load public key
|
||||||
|
@ -143,7 +143,6 @@ namespace Components
|
|||||||
|
|
||||||
if (Window::CursorVisible)
|
if (Window::CursorVisible)
|
||||||
{
|
{
|
||||||
// TODO: Apply custom cursor
|
|
||||||
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
SetCursor(LoadCursor(NULL, IDC_ARROW));
|
||||||
|
|
||||||
while ((value = ShowCursor(TRUE)) < 0);
|
while ((value = ShowCursor(TRUE)) < 0);
|
||||||
|
@ -48,9 +48,9 @@ namespace Utils
|
|||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreateDirectory(std::string dir)
|
bool CreateDirectory(std::string dir)
|
||||||
{
|
{
|
||||||
char opath[MAX_PATH];
|
char opath[MAX_PATH] = { 0 };
|
||||||
char *p;
|
char *p;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
@ -70,7 +70,10 @@ namespace Utils
|
|||||||
|
|
||||||
if (_access(opath, 0))
|
if (_access(opath, 0))
|
||||||
{
|
{
|
||||||
_mkdir(opath);
|
if (_mkdir(opath) == -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*p = L'\\';
|
*p = L'\\';
|
||||||
@ -79,8 +82,13 @@ namespace Utils
|
|||||||
|
|
||||||
if (_access(opath, 0))
|
if (_access(opath, 0))
|
||||||
{
|
{
|
||||||
_mkdir(opath);
|
if (_mkdir(opath) == -1)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,6 @@ namespace Utils
|
|||||||
bool FileExists(std::string file);
|
bool FileExists(std::string file);
|
||||||
void WriteFile(std::string file, std::string data);
|
void WriteFile(std::string file, std::string data);
|
||||||
std::string ReadFile(std::string file);
|
std::string ReadFile(std::string file);
|
||||||
void CreateDirectory(std::string dir);
|
bool CreateDirectory(std::string dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user