diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index cdd94a70f..c49afd9d2 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -2398,8 +2398,9 @@ void UINpcTextEditDialogWnd::InsertSkillTag(int tagId) { std::string tag = this->m_tagCtrl->sub_874A40(tagId, 0xD630A9); { + auto* const tagCtrl = this->m_tagCtrl; std::string text = this->edit->Text(); - this->m_tagCtrl->taggedText = text; + tagCtrl->taggedText = text; } this->edit->SetText((this->edit->Text() + tag).c_str()); this->edit->MoveCursorToEnd(); diff --git a/Source/UI/Buttons/UITextButton.cpp b/Source/UI/Buttons/UITextButton.cpp index fbbbd9015..7d17d3699 100644 --- a/Source/UI/Buttons/UITextButton.cpp +++ b/Source/UI/Buttons/UITextButton.cpp @@ -411,7 +411,7 @@ void UIBarGraph4::Slot28(int, int) { // OFFSET: 0x008918D0 // FUNCTION: fn_11452 void UIINT64BarGraph::Slot28(int, int) { - if (this->m_maximum < this->m_current || this->m_maximum == 0 || this->m_maximum == 99999999) { + if (this->m_maximum < this->m_current || 0 == this->m_maximum || this->m_maximum == 99999999) { return; } diff --git a/Source/UI/Chat/UIWhisperWnd.cpp b/Source/UI/Chat/UIWhisperWnd.cpp index 260a4cfdc..504542b7e 100644 --- a/Source/UI/Chat/UIWhisperWnd.cpp +++ b/Source/UI/Chat/UIWhisperWnd.cpp @@ -4,5 +4,5 @@ // FUNCTION: fn_11984 UIWhisperWnd::UIWhisperWnd() : UIFrameWnd(0) { this->unknown_0100 = 0; - this->m_code = std::string(); + this->m_code = std::string(""); } diff --git a/Source/UI/Enchant/UIEnchantUI.cpp b/Source/UI/Enchant/UIEnchantUI.cpp index e61633957..03cd600a7 100644 --- a/Source/UI/Enchant/UIEnchantUI.cpp +++ b/Source/UI/Enchant/UIEnchantUI.cpp @@ -1412,8 +1412,9 @@ void CUIEnchantUI::Slot53() { // FUNCTION: fn_14993 void EnchantUI::CUIUpgradeRandom::Slot16() { EnchantUI::CUIEnchantPage::Slot16(); - this->enchantList->unknown_00C4 = 1; - this->enchantList->Invalidate(); + auto* const list = this->enchantList; + list->unknown_00C4 = 1; + list->Invalidate(); } namespace EnchantUI { diff --git a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp index b11398e2d..8a444e5d5 100644 --- a/Source/UI/ProbabilityTable/UIProbabilityTable.cpp +++ b/Source/UI/ProbabilityTable/UIProbabilityTable.cpp @@ -417,7 +417,7 @@ void CUIListBoxEx::Selec return; } for (ProbabilityTable::CUIItem* other : this->items) { - if (other != item) { + if (item != other) { other->SetSelected(0); } } @@ -432,7 +432,13 @@ void CUIListBoxEx::Selec this->selected = selectedItem->index; if (this->onSelect && static_cast(this->selected) >= 0 && this->selected < this->data.size()) { auto node = this->data.begin(); - std::advance(node, static_cast(this->selected)); + int count = static_cast(this->selected); + if (count > 0) { + do { + ++node; + --count; + } while (count > 0); + } this->onSelect(selectedItem, *node); } } diff --git a/Source/UI/Quest/UIRenewQuestUI.cpp b/Source/UI/Quest/UIRenewQuestUI.cpp index 1d435c914..719dc4bd5 100644 --- a/Source/UI/Quest/UIRenewQuestUI.cpp +++ b/Source/UI/Quest/UIRenewQuestUI.cpp @@ -764,7 +764,13 @@ __declspec(noinline) void CUIListBoxExselected = selectedItem->index; if (this->onSelect && static_cast(this->selected) >= 0 && this->selected < this->data.size()) { auto node = this->data.begin(); - std::advance(node, static_cast(this->selected)); + int count = static_cast(this->selected); + if (count > 0) { + do { + ++node; + --count; + } while (count > 0); + } this->onSelect(selectedItem, *node); } } diff --git a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp index 5b01ff7af..5ea5578a0 100644 --- a/Source/UI/RuneSystem/UIRuneSystemWnd.cpp +++ b/Source/UI/RuneSystem/UIRuneSystemWnd.cpp @@ -96,12 +96,12 @@ int UIRune_Decom::HitTestItem(int x, int y) { // OFFSET: 0x00818300 // FUNCTION: fn_10174 void UIRune_Info::Slot15(int, int) { - this->m_activeWnd = new (std::nothrow) UIRuneSystem_ActiveWnd(); + this->m_activeWnd = new UIRuneSystem_ActiveWnd(); this->AddChild(this->m_activeWnd); this->m_activeWnd->SetSize(0xEA, 0x78); this->m_activeWnd->Move(0xC5, 0x159); - this->m_activateButton = new (std::nothrow) UIBitmapButton(); + this->m_activateButton = new UIBitmapButton(); this->AddChild(this->m_activateButton); this->m_activateButton->SetBitmap("유저인터페이스\\runesystem\\bt_active_nomal.bmp", 0, 0); this->m_activateButton->SetBitmap("유저인터페이스\\runesystem\\bt_active_mouseon.bmp", 1, 0); diff --git a/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp b/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp index 675f3d489..bfe5f7e82 100644 --- a/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp +++ b/Source/UI/SelectPackageItemBox/UISelectPackageItemBox.cpp @@ -653,8 +653,9 @@ void CUIItemInfo::Paint() { // OFFSET: 0x00A703B0 // FUNCTION: fn_16785 void CUIItemInfo::Slot16() { - this->gameItem->showOverlay = 1; - this->gameItem->Invalidate(); + auto* const item = this->gameItem; + item->showOverlay = 1; + item->Invalidate(); } // OFFSET: 0x00A705E0 @@ -1235,10 +1236,12 @@ void CUISelectPackageItemBox::BindItem(SelectPackageItemBox::CUIItemInfo* item, // FUNCTION: fn_16786 void CUISelectPackageItemBox::Slot16() { this->Move((g_renderer->viewport.width - this->geometry.width) / 2, (g_renderer->viewport.height - this->geometry.height) / 2); - this->itemList->unknown_00C4 = 1; - this->itemList->Invalidate(); - this->okButton->disabled = 1; - this->okButton->Invalidate(); + auto* const list = this->itemList; + list->unknown_00C4 = 1; + list->Invalidate(); + auto* const ok = this->okButton; + ok->disabled = 1; + ok->Invalidate(); this->okButton->SetText(LookupMessage(3384)); this->cancelButton->SetText(LookupMessage(3045)); } diff --git a/Source/UI/StylingShop/UIStylingShopWnd.cpp b/Source/UI/StylingShop/UIStylingShopWnd.cpp index 4ece5ae48..e2f40880b 100644 --- a/Source/UI/StylingShop/UIStylingShopWnd.cpp +++ b/Source/UI/StylingShop/UIStylingShopWnd.cpp @@ -299,7 +299,7 @@ int UIBasicStylingWnd::SendMsg(UIWindow* sender, int message, std::intptr_t argu if (!unselected) { this->m_defaultPaletteButton->SetState(0); - } else if (sender == this->m_defaultPaletteButton) { + } else if (unselected == true && sender == this->m_defaultPaletteButton) { this->m_display->unknown_0094 = 0; this->m_display->Invalidate(); }