mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 01:37:00 +00:00
Fix some codacy detected issues
This commit is contained in:
parent
e69d69cfab
commit
603389992d
5 changed files with 17 additions and 17 deletions
|
|
@ -6892,12 +6892,12 @@ bool ChatHandler::HandleAccountSetAddonCommand(char* args)
|
|||
bool ChatHandler::HandleSendMailHelper(MailDraft& draft, char* args)
|
||||
{
|
||||
// format: "subject text" "mail text"
|
||||
char* msgSubject = ExtractQuotedArg(&args);
|
||||
if (!msgSubject)
|
||||
std::string msgSubject = ExtractQuotedArg(&args);
|
||||
if (msgSubject.empty())
|
||||
{ return false; }
|
||||
|
||||
char* msgText = ExtractQuotedArg(&args);
|
||||
if (!msgText)
|
||||
std::string msgText = ExtractQuotedArg(&args);
|
||||
if (msgText.empty())
|
||||
{ return false; }
|
||||
|
||||
// msgSubject, msgText isn't NUL after prev. check
|
||||
|
|
@ -6939,12 +6939,12 @@ bool ChatHandler::HandleSendMassMailCommand(char* args)
|
|||
bool ChatHandler::HandleSendItemsHelper(MailDraft& draft, char* args)
|
||||
{
|
||||
// format: "subject text" "mail text" item1[:count1] item2[:count2] ... item12[:count12]
|
||||
char* msgSubject = ExtractQuotedArg(&args);
|
||||
if (!msgSubject)
|
||||
std::string msgSubject = ExtractQuotedArg(&args);
|
||||
if (msgSubject.empty())
|
||||
{ return false; }
|
||||
|
||||
char* msgText = ExtractQuotedArg(&args);
|
||||
if (!msgText)
|
||||
std::string msgText = ExtractQuotedArg(&args);
|
||||
if (msgText.empty())
|
||||
{ return false; }
|
||||
|
||||
// extract items
|
||||
|
|
@ -7074,8 +7074,8 @@ bool ChatHandler::HandleSendMoneyHelper(MailDraft& draft, char* args)
|
|||
{
|
||||
/// format: "subject text" "mail text" money
|
||||
|
||||
char* msgSubject = ExtractQuotedArg(&args);
|
||||
if (!msgSubject)
|
||||
std::string msgSubject = ExtractQuotedArg(&args);
|
||||
if (msgSubject.empty())
|
||||
{ return false; }
|
||||
|
||||
char* msgText = ExtractQuotedArg(&args);
|
||||
|
|
|
|||
|
|
@ -868,9 +868,9 @@ bool ChatHandler::HandleGetValueHelper(Object* target, uint32 field, char* typeS
|
|||
// starting 0 if need as required bitstring format
|
||||
std::string res;
|
||||
res.reserve(1 + 32 + 1);
|
||||
res = iValue & (1 << (32 - 1)) ? "0" : " ";
|
||||
res = (iValue & (1 << (32 - 1))) ? "0" : " ";
|
||||
for (int i = 32; i > 0; --i)
|
||||
{ res += iValue & (1 << (i - 1)) ? "1" : "0"; }
|
||||
{ res += (iValue & (1 << (i - 1))) ? "1" : "0"; }
|
||||
DEBUG_LOG(GetMangosString(LANG_GET_BITSTR), guid.GetString().c_str(), field, res.c_str());
|
||||
PSendSysMessage(LANG_GET_BITSTR_FIELD, guid.GetString().c_str(), field, res.c_str());
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1766,8 +1766,8 @@ bool Map::ScriptsStart(DBScriptType type, uint32 id, Object* source, Object* tar
|
|||
for (ScriptScheduleMap::const_iterator searchItr = m_scriptSchedule.begin(); searchItr != m_scriptSchedule.end(); ++searchItr)
|
||||
{
|
||||
if (searchItr->second.IsSameScript(type, id,
|
||||
execParams & SCRIPT_EXEC_PARAM_UNIQUE_BY_SOURCE ? sourceGuid : ObjectGuid(),
|
||||
execParams & SCRIPT_EXEC_PARAM_UNIQUE_BY_TARGET ? targetGuid : ObjectGuid(), ownerGuid))
|
||||
(execParams & SCRIPT_EXEC_PARAM_UNIQUE_BY_SOURCE) ? sourceGuid : ObjectGuid(),
|
||||
(execParams & SCRIPT_EXEC_PARAM_UNIQUE_BY_TARGET) ? targetGuid : ObjectGuid(), ownerGuid))
|
||||
{
|
||||
DEBUG_LOG("DB-SCRIPTS: Process table `dbscripts [type=%d]` id %u. Skip script as script already started for source %s, target %s - ScriptsStartParams %u", type, id, sourceGuid.GetString().c_str(), targetGuid.GetString().c_str(), execParams);
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1540,7 +1540,7 @@ bool ScriptAction::HandleScriptStep()
|
|||
if (m_script->playSound.flags & 2)
|
||||
{ pSource->PlayDistanceSound(m_script->playSound.soundId, pSoundTarget); }
|
||||
else if (m_script->playSound.flags & (4 | 8))
|
||||
{ m_map->PlayDirectSoundToMap(m_script->playSound.soundId, m_script->playSound.flags & 8 ? pSource->GetZoneId() : 0); }
|
||||
{ m_map->PlayDirectSoundToMap(m_script->playSound.soundId, (m_script->playSound.flags & 8) ? pSource->GetZoneId() : 0); }
|
||||
else
|
||||
{ pSource->PlayDirectSound(m_script->playSound.soundId, pSoundTarget); }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2259,7 +2259,7 @@ void World::ShutdownMsg(bool show /*= false*/, Player* player /*= NULL*/)
|
|||
ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME;
|
||||
|
||||
SendServerMessage(msgid, str.c_str(), player);
|
||||
DEBUG_LOG("Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shutting down"), str.c_str());
|
||||
DEBUG_LOG("Server is %s in %s", (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? "restart" : "shutting down", str.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2279,7 +2279,7 @@ void World::ShutdownCancel()
|
|||
m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value
|
||||
SendServerMessage(msgid);
|
||||
|
||||
DEBUG_LOG("Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shutdown"));
|
||||
DEBUG_LOG("Server %s cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? "restart" : "shutdown");
|
||||
|
||||
///- Used by Eluna
|
||||
#ifdef ENABLE_ELUNA
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue