[General] Small cleanup (#479)
* [General] Small cleanup * [Bots] Use ZeroMemory
This commit is contained in:
parent
788782903e
commit
2b774b6c41
@ -132,7 +132,7 @@ namespace Components
|
||||
return;
|
||||
}
|
||||
|
||||
g_botai[entref.entnum] = {0};
|
||||
ZeroMemory(&g_botai[entref.entnum], sizeof(BotMovementInfo));
|
||||
g_botai[entref.entnum].weapon = 1;
|
||||
g_botai[entref.entnum].active = true;
|
||||
});
|
||||
@ -317,7 +317,7 @@ namespace Components
|
||||
// Zero the bot command array
|
||||
for (std::size_t i = 0; i < std::extent_v<decltype(g_botai)>; ++i)
|
||||
{
|
||||
std::memset(&g_botai[i], 0, sizeof(BotMovementInfo));
|
||||
ZeroMemory(&g_botai[i], sizeof(BotMovementInfo));
|
||||
g_botai[i].weapon = 1; // Prevent the bots from defaulting to the 'none' weapon
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,11 @@ namespace Components
|
||||
HKEY hKey = nullptr;
|
||||
std::string data;
|
||||
|
||||
char ownPth[MAX_PATH] = { 0 };
|
||||
char workdir[MAX_PATH] = { 0 };
|
||||
char ownPth[MAX_PATH] = {0};
|
||||
char workdir[MAX_PATH] = {0};
|
||||
|
||||
DWORD dwsize = MAX_PATH;
|
||||
HMODULE hModule = GetModuleHandle(nullptr);
|
||||
HMODULE hModule = GetModuleHandleA(nullptr);
|
||||
|
||||
if (hModule != nullptr)
|
||||
{
|
||||
@ -44,7 +44,7 @@ namespace Components
|
||||
}
|
||||
else
|
||||
{
|
||||
char* endPtr = strstr(workdir, "iw4x.exe");
|
||||
auto* endPtr = std::strstr(workdir, "iw4x.exe");
|
||||
if (endPtr != nullptr)
|
||||
{
|
||||
*endPtr = 0;
|
||||
@ -183,7 +183,7 @@ namespace Components
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
cmdLine = cmdLine.substr(pos + 7);
|
||||
pos = cmdLine.find_first_of("/");
|
||||
pos = cmdLine.find_first_of('/');
|
||||
|
||||
if (pos != std::string::npos)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user