mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Fix static analysis issues
This commit is contained in:
@@ -1596,7 +1596,7 @@ void WorldSession::HandleCharFactionOrRaceChangeCallback(std::shared_ptr<Charact
|
||||
uint8 oldRace = characterInfo->Race;
|
||||
uint8 playerClass = characterInfo->Class;
|
||||
uint8 level = characterInfo->Level;
|
||||
std::string oldName = characterInfo->Name;
|
||||
//std::string oldName = characterInfo->Name;
|
||||
|
||||
if (!sObjectMgr->GetPlayerInfo(factionChangeInfo->Race, playerClass))
|
||||
{
|
||||
|
||||
@@ -359,7 +359,7 @@ bool PlayerDumpWriter::GetDump(ObjectGuid::LowType guid, std::string &dump)
|
||||
DumpReturn PlayerDumpWriter::WriteDump(const std::string& file, ObjectGuid::LowType guid)
|
||||
{
|
||||
if (sWorld->getBoolConfig(CONFIG_PDUMP_NO_PATHS))
|
||||
if (strstr(file.c_str(), "\\") || strstr(file.c_str(), "/"))
|
||||
if (strchr(file.c_str(), '\\') || strchr(file.c_str(), '/'))
|
||||
return DUMP_FILE_OPEN_ERROR;
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_PDUMP_NO_OVERWRITE))
|
||||
|
||||
@@ -180,7 +180,7 @@ uint32 ReadBuild(int locale)
|
||||
|
||||
size_t pos = text.find("version=\"");
|
||||
size_t pos1 = pos + strlen("version=\"");
|
||||
size_t pos2 = text.find("\"",pos1);
|
||||
size_t pos2 = text.find('"',pos1);
|
||||
if (pos == text.npos || pos2 == text.npos || pos1 >= pos2)
|
||||
{
|
||||
printf("Fatal error: Invalid %s file format!\n", filename.c_str());
|
||||
|
||||
@@ -92,8 +92,8 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
|
||||
Adtfilename.erase(Adtfilename.find(".adt"),4);
|
||||
std::string TempMapNumber;
|
||||
TempMapNumber = Adtfilename.substr(Adtfilename.length()-6,6);
|
||||
xMap = TempMapNumber.substr(TempMapNumber.find("_")+1,(TempMapNumber.find_last_of("_")-1) - (TempMapNumber.find("_")));
|
||||
yMap = TempMapNumber.substr(TempMapNumber.find_last_of("_")+1,(TempMapNumber.length()) - (TempMapNumber.find_last_of("_")));
|
||||
xMap = TempMapNumber.substr(TempMapNumber.find('_')+1,(TempMapNumber.find_last_of('_')-1) - (TempMapNumber.find('_')));
|
||||
yMap = TempMapNumber.substr(TempMapNumber.find_last_of('_')+1,(TempMapNumber.length()) - (TempMapNumber.find_last_of('_')));
|
||||
Adtfilename.erase((Adtfilename.length()-xMap.length()-yMap.length()-2), (xMap.length()+yMap.length()+2));
|
||||
//string AdtMapNumber = xMap + ' ' + yMap + ' ' + GetPlainName((char*)Adtfilename.c_str());
|
||||
//printf("Processing map %s...\n", AdtMapNumber.c_str());
|
||||
|
||||
Reference in New Issue
Block a user