chore(Core/EventMgr): Align code to Code standard & improve LoadFromDB function (#21151)

Co-authored-by: Jelle Meeus <sogladev@gmail.com>
Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
This commit is contained in:
Exitare
2025-02-07 05:25:07 -08:00
committed by GitHub
parent 2e91c83433
commit ff4d1ef053
10 changed files with 1068 additions and 991 deletions

View File

@@ -269,17 +269,13 @@ public:
static bool HandleLookupEventCommand(ChatHandler* handler, Tail namePart)
{
if (namePart.empty())
{
return false;
}
std::wstring wNamePart;
// converting string that we try to find to lower case
if (!Utf8toWStr(namePart, wNamePart))
{
return false;
}
wstrToLower(wNamePart);
@@ -294,11 +290,9 @@ public:
{
GameEventData const& eventData = events[id];
std::string descr = eventData.description;
std::string descr = eventData.Description;
if (descr.empty())
{
continue;
}
if (Utf8FitTo(descr, wNamePart))
{
@@ -311,25 +305,17 @@ public:
std::string active = activeEvents.find(id) != activeEvents.end() ? handler->GetAcoreString(LANG_ACTIVE) : "";
if (handler->GetSession())
{
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description, active);
}
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.Description, active);
else
{
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description, active);
}
handler->PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.Description, active);
if (!found)
{
found = true;
}
}
}
if (!found)
{
handler->SendSysMessage(LANG_NOEVENTFOUND);
}
return true;
}