mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Minor fixes in preparation to support fmt v10
This commit is contained in:
@@ -114,7 +114,7 @@ public:
|
||||
std::string occurenceStr = secsToTimeString(eventData.occurence * MINUTE);
|
||||
std::string lengthStr = secsToTimeString(eventData.length * MINUTE);
|
||||
|
||||
handler->PSendSysMessage(LANG_EVENT_INFO, eventId, eventData.description.c_str(), activeStr,
|
||||
handler->PSendSysMessage(LANG_EVENT_INFO, *eventId, eventData.description.c_str(), activeStr,
|
||||
startTimeStr.c_str(), endTimeStr.c_str(), occurenceStr.c_str(), lengthStr.c_str(),
|
||||
nextStr.c_str());
|
||||
return true;
|
||||
@@ -142,7 +142,7 @@ public:
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
|
||||
if (activeEvents.find(eventId) != activeEvents.end())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE, eventId);
|
||||
handler->PSendSysMessage(LANG_EVENT_ALREADY_ACTIVE, *eventId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ public:
|
||||
|
||||
if (activeEvents.find(eventId) == activeEvents.end())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_EVENT_NOT_ACTIVE, eventId);
|
||||
handler->PSendSysMessage(LANG_EVENT_NOT_ACTIVE, *eventId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ public:
|
||||
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(nodeId);
|
||||
if (!node)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GOTAXINODENOTFOUND, nodeId);
|
||||
handler->PSendSysMessage(LANG_COMMAND_GOTAXINODENOTFOUND, *nodeId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -314,7 +314,7 @@ public:
|
||||
AreaTriggerEntry const* at = sAreaTriggerStore.LookupEntry(areaTriggerId);
|
||||
if (!at)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND, areaTriggerId);
|
||||
handler->PSendSysMessage(LANG_COMMAND_GOAREATRNOTFOUND, *areaTriggerId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
GameObjectTemplate const* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
|
||||
if (!objectInfo)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, objectId);
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, *objectId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
{
|
||||
// report to DB errors log as in loading case
|
||||
TC_LOG_ERROR("sql.sql", "Gameobject (Entry {} GoType: {}) have invalid displayId ({}), not spawned.", *objectId, objectInfo->type, objectInfo->displayId);
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA, objectId);
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_HAVE_INVALID_DATA, *objectId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
/// @todo is it really necessary to add both the real and DB table guid here ?
|
||||
sObjectMgr->AddGameobjectToGrid(ASSERT_NOTNULL(sObjectMgr->GetGameObjectData(spawnId)));
|
||||
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, objectId, objectInfo->name.c_str(), std::to_string(spawnId).c_str(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_ADD, *objectId, objectInfo->name.c_str(), std::to_string(spawnId).c_str(), player->GetPositionX(), player->GetPositionY(), player->GetPositionZ());
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
|
||||
if (!sObjectMgr->GetGameObjectTemplate(objectId))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, objectId);
|
||||
handler->PSendSysMessage(LANG_GAMEOBJECT_NOT_EXIST, *objectId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -303,7 +303,7 @@ public:
|
||||
Unit* owner = ObjectAccessor::GetUnit(*player, ownerGuid);
|
||||
if (!owner || !ownerGuid.IsPlayer())
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, ownerGuid.GetCounter(), spawnId);
|
||||
handler->PSendSysMessage(LANG_COMMAND_DELOBJREFERCREATURE, std::to_string(*spawnId).c_str(), ownerGuid.ToString().c_str());
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creatureId);
|
||||
if (!cInfo)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, creatureId);
|
||||
handler->PSendSysMessage(LANG_COMMAND_INVALIDCREATUREID, *creatureId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ public:
|
||||
while (result->NextRow());
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, creatureId, creatureCount);
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTCREATUREMESSAGE, *creatureId, creatureCount);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -350,7 +350,7 @@ public:
|
||||
GameObjectTemplate const* gInfo = sObjectMgr->GetGameObjectTemplate(gameObjectId);
|
||||
if (!gInfo)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, gameObjectId);
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTOBJINVALIDID, *gameObjectId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -416,7 +416,7 @@ public:
|
||||
while (result->NextRow());
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, gameObjectId, objectCount);
|
||||
handler->PSendSysMessage(LANG_COMMAND_LISTOBJMESSAGE, *gameObjectId, objectCount);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1472,7 +1472,7 @@ public:
|
||||
// prevent generation all items with itemset field value '0'
|
||||
if (*itemSetId == 0)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId);
|
||||
handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, *itemSetId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1535,7 +1535,7 @@ public:
|
||||
|
||||
if (!found)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, itemSetId);
|
||||
handler->PSendSysMessage(LANG_NO_ITEMS_FROM_ITEMSET_FOUND, *itemSetId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1588,7 +1588,7 @@ public:
|
||||
SkillLineEntry const* skillLine = sSkillLineStore.LookupEntry(skillId);
|
||||
if (!skillLine)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_SKILL_ID, skillId);
|
||||
handler->PSendSysMessage(LANG_INVALID_SKILL_ID, *skillId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -1606,7 +1606,7 @@ public:
|
||||
// add the skill to the player's book with step 1 (which is the first rank, in most cases something
|
||||
// like 'Apprentice <skill>'.
|
||||
target->SetSkill(skillId, targetHasSkill ? target->GetSkillStep(skillId) : 1, level, max);
|
||||
handler->PSendSysMessage(LANG_SET_SKILL, skillId, skillLine->DisplayName[handler->GetSessionDbcLocale()], handler->GetNameLink(target).c_str(), level, max);
|
||||
handler->PSendSysMessage(LANG_SET_SKILL, *skillId, skillLine->DisplayName[handler->GetSessionDbcLocale()], handler->GetNameLink(target).c_str(), level, max);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(titleId);
|
||||
if (!titleInfo)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TITLE_ID, titleId);
|
||||
handler->PSendSysMessage(LANG_INVALID_TITLE_ID, *titleId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
target->SetTitle(titleInfo);
|
||||
target->SetChosenTitle(titleInfo->MaskID);
|
||||
|
||||
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, titleId, titleNameStr.c_str(), tNameLink.c_str());
|
||||
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, *titleId, titleNameStr.c_str(), tNameLink.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(titleId);
|
||||
if (!titleInfo)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TITLE_ID, titleId);
|
||||
handler->PSendSysMessage(LANG_INVALID_TITLE_ID, *titleId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
std::string titleNameStr = fmt::sprintf(target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName());
|
||||
|
||||
target->SetTitle(titleInfo);
|
||||
handler->PSendSysMessage(LANG_TITLE_ADD_RES, titleId, titleNameStr.c_str(), tNameLink.c_str());
|
||||
handler->PSendSysMessage(LANG_TITLE_ADD_RES, *titleId, titleNameStr.c_str(), tNameLink.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
CharTitlesEntry const* titleInfo = sCharTitlesStore.LookupEntry(titleId);
|
||||
if (!titleInfo)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_INVALID_TITLE_ID, titleId);
|
||||
handler->PSendSysMessage(LANG_INVALID_TITLE_ID, *titleId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -148,7 +148,7 @@ public:
|
||||
std::string tNameLink = handler->GetNameLink(target);
|
||||
std::string titleNameStr = fmt::sprintf(target->GetNativeGender() == GENDER_MALE ? titleInfo->Name[handler->GetSessionDbcLocale()] : titleInfo->Name1[handler->GetSessionDbcLocale()], target->GetName());
|
||||
|
||||
handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, titleId, titleNameStr.c_str(), tNameLink.c_str());
|
||||
handler->PSendSysMessage(LANG_TITLE_REMOVE_RES, *titleId, titleNameStr.c_str(), tNameLink.c_str());
|
||||
|
||||
if (!target->HasTitle(target->m_playerData->PlayerTitle))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user