diff --git a/Source/UI/Chat/UISubChatHisWnd.cpp b/Source/UI/Chat/UISubChatHisWnd.cpp index 90cd3d4df..4deb338ab 100644 --- a/Source/UI/Chat/UISubChatHisWnd.cpp +++ b/Source/UI/Chat/UISubChatHisWnd.cpp @@ -174,16 +174,18 @@ void UISubChatHisWnd::OnCreate(int width, int height) { this->m_resizer->SetColors(0xFFFF00FF, 0xFFFF00FF); this->AddChild(this->m_resizer); - int x = 0; - int y = 0; - this->ToScreen(x, y); - this->m_state.x = x; - this->m_state.backgroundColor = 0x66000000; - this->m_state.y = y + this->m_inputHeight; - this->m_state.width = this->geometry.width; - this->m_state.flags = 0; - this->m_state.height = this->geometry.height - this->m_inputHeight; - this->m_state.borderStyle = 0; + { + int x = 0; + int y = 0; + this->ToScreen(x, y); + this->m_state.x = x; + this->m_state.backgroundColor = 0x66000000; + this->m_state.y = y + this->m_inputHeight; + this->m_state.width = this->geometry.width; + this->m_state.flags = 0; + this->m_state.height = this->geometry.height - this->m_inputHeight; + this->m_state.borderStyle = 0; + } const auto found = g_session.m_subChatWnds.find(this->m_index); if (found != g_session.m_subChatWnds.end()) { diff --git a/Source/UI/Guild/UIAgitWnd.cpp b/Source/UI/Guild/UIAgitWnd.cpp index 138aa966d..3c8224a4e 100644 --- a/Source/UI/Guild/UIAgitWnd.cpp +++ b/Source/UI/Guild/UIAgitWnd.cpp @@ -159,10 +159,10 @@ int UIListBoxAgitMenu::SendMsg(UIWindow* sender, int message, std::intptr_t a, s return 0; } + char* agitName = nullptr; GuildInfo* guildInfo = &g_guildInfo; uint16_t agitId = static_cast(guildInfo->GetAgitId(this->m_agitIndex)); - char* agitName = nullptr; g_session.m_hotkeyScript->Call("get_agit_name", "d>s", agitId, &agitName); if (strnlen(agitName, 256) != 0) { int costZeny = 0; diff --git a/Source/UI/Party/UIRequestJoinPartyMgr.cpp b/Source/UI/Party/UIRequestJoinPartyMgr.cpp index af71703ce..05c1883fa 100644 --- a/Source/UI/Party/UIRequestJoinPartyMgr.cpp +++ b/Source/UI/Party/UIRequestJoinPartyMgr.cpp @@ -94,7 +94,7 @@ void UIRequestJoinPartyMgr::Advance() { } PartyJoinRequest request = *first; - if (std::find(this->m_blocked.begin(), this->m_blocked.end(), request.accountId) != this->m_blocked.end()) { + if (std::find_if(this->m_blocked.begin(), this->m_blocked.end(), [&](int accountId) { return request.accountId == accountId; }) != this->m_blocked.end()) { this->m_pending.pop_front(); this->Advance(); return; diff --git a/Source/UI/Rodex/UIRodexContentsWnd.cpp b/Source/UI/Rodex/UIRodexContentsWnd.cpp index cfde9c80c..ac270fd06 100644 --- a/Source/UI/Rodex/UIRodexContentsWnd.cpp +++ b/Source/UI/Rodex/UIRodexContentsWnd.cpp @@ -82,13 +82,12 @@ ITEM_INFO UIRodexContentsWnd::GetItemAtPoint(int x, int y) { this->m_itemIndex = 0; int index = 0; - int left = 30; for (auto item = this->m_items.begin(); item != this->m_items.end(); ++item) { + const int left = 30 + index * 34; if (x > left && x < left + 24) { return *item; } ++index; - left += 34; this->m_itemIndex = index; } return ITEM_INFO(0);