diff --git a/Source/Client/Replay.cpp b/Source/Client/Replay.cpp index 4987832a..0c0094f6 100644 --- a/Source/Client/Replay.cpp +++ b/Source/Client/Replay.cpp @@ -764,7 +764,7 @@ bool ReplayFileList::Select(int index) { const int count = static_cast(this->files.size()); - if (index >= count) { + if (count <= index) { index = count - 1; } diff --git a/Source/Contents/Effects/Particle.cpp b/Source/Contents/Effects/Particle.cpp index cacd8321..9fa333a2 100644 --- a/Source/Contents/Effects/Particle.cpp +++ b/Source/Contents/Effects/Particle.cpp @@ -796,9 +796,9 @@ void CParticle::SetQuad(RenderVertex* vertices, float top, float bottom, float l vertices[2].diffuse = color; vertices[3].diffuse = color; + vertices[0].u = left; vertices[0].v = top; vertices[1].v = top; - vertices[0].u = left; vertices[1].u = right; vertices[2].u = left; vertices[2].v = bottom; diff --git a/Source/Contents/Models/ModelActor.cpp b/Source/Contents/Models/ModelActor.cpp index 0f3d7a7f..a57ddbf2 100644 --- a/Source/Contents/Models/ModelActor.cpp +++ b/Source/Contents/Models/ModelActor.cpp @@ -182,7 +182,7 @@ void C3dActorV2::Animate(double frame) { void C3dActor::SetSpeed(float speed) { this->speed = speed; - if (speed != 0.0f) { + if (0.0f != speed) { this->speed = speed / 3.0f; } } diff --git a/Source/Render/DX9/RendererDX9Operations.cpp b/Source/Render/DX9/RendererDX9Operations.cpp index 1e6add93..b7d5c130 100644 --- a/Source/Render/DX9/RendererDX9Operations.cpp +++ b/Source/Render/DX9/RendererDX9Operations.cpp @@ -35,8 +35,8 @@ void CRendererDX9::SetLighting(const float* direction, const float* diffuse, con light.Diffuse.a = 255.0f; light.Ambient.r = ambient[0]; light.Ambient.g = ambient[1]; - light.Ambient.b = ambient[2]; light.Ambient.a = 255.0f; + light.Ambient.b = ambient[2]; this->nativeDevice->SetLight(0, &light); this->nativeDevice->LightEnable(0, TRUE); diff --git a/Source/UI/Layout/SnapMgr.cpp b/Source/UI/Layout/SnapMgr.cpp index fcbf120e..b971e03f 100644 --- a/Source/UI/Layout/SnapMgr.cpp +++ b/Source/UI/Layout/SnapMgr.cpp @@ -214,7 +214,7 @@ void CSnapMgr::ConstrainGroup(UIWindow* window, int& dx, int& dy) { // OFFSET: 0x007E3390 // FUNCTION: fn_09718 void CSnapMgr::MoveConnected(UIWindow* window, int dx, int dy) { - if (!this->root || this->root->window != window) { + if (!this->root || window != this->root->window) { return; } diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index 02fbd1bf..b2da8a9d 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -504,9 +504,9 @@ void UIChangeMaterialWnd_List::SortItems(bool ascending) { // FUNCTION: fn_03898 void UIChangeMaterialWnd_List::ShiftSelectedIndex(int value) { const int index = static_cast(std::max(0, this->m_selectedIndex - value)); - if (index < this->m_scrollOffset || index >= this->m_scrollOffset + this->m_pageSize) { + if (index < this->m_scrollOffset || this->m_scrollOffset + this->m_pageSize <= index) { int newOffset = this->m_previousScrollOffset; - if (index < newOffset || index >= newOffset + this->m_pageSize) { + if (index < newOffset || newOffset + this->m_pageSize <= index) { newOffset = index > 0 ? index : 0; } diff --git a/Source/UI/UIRefiningWnd.cpp b/Source/UI/UIRefiningWnd.cpp index 3e895367..cce1cd8f 100644 --- a/Source/UI/UIRefiningWnd.cpp +++ b/Source/UI/UIRefiningWnd.cpp @@ -654,7 +654,7 @@ void UIRefiningWnd::Slot19() { // OFFSET: 0x007F7D80 // FUNCTION: fn_09918 void UIRefining_Notice::Slot19() { - if (this->expireTick != 0 && this->expireTick < timeGetTime()) { + if (this->expireTick != 0 && timeGetTime() > this->expireTick) { this->expireTick = 0; if (this->autoShown == 1) { this->autoShown = 0; diff --git a/Source/UI/UIReputeWnd.cpp b/Source/UI/UIReputeWnd.cpp index dade0a76..55b33ac3 100644 --- a/Source/UI/UIReputeWnd.cpp +++ b/Source/UI/UIReputeWnd.cpp @@ -342,7 +342,7 @@ void UIReputeWnd::SetPage(unsigned int page) { this->m_page = std::max(1u, std::min(this->m_pageCount, page)); this->m_prevButton->Enable(this->m_page > 1); - this->m_nextButton->Enable(this->m_page < this->m_pageCount); + this->m_nextButton->Enable(this->m_pageCount > this->m_page); } // OFFSET: 0x00610C80 diff --git a/Source/UI/Window/UIBitmapTab.cpp b/Source/UI/Window/UIBitmapTab.cpp index 70b4bc59..7de94f1c 100644 --- a/Source/UI/Window/UIBitmapTab.cpp +++ b/Source/UI/Window/UIBitmapTab.cpp @@ -29,7 +29,7 @@ void UIBitmapTab::Slot25(int, int y) { int bottom = 0; for (unsigned index = 0; index < this->tabs.size(); ++index) { bottom += this->tabs[index].height; - if (bottom > y) { + if (y < bottom) { if (this->geometry.unknown_0030 != index) { this->geometry.unknown_0030 = index; this->Invalidate(); diff --git a/Source/Utility/Text/StringUtil.cpp b/Source/Utility/Text/StringUtil.cpp index 41f5674b..a7ae74c1 100644 --- a/Source/Utility/Text/StringUtil.cpp +++ b/Source/Utility/Text/StringUtil.cpp @@ -97,7 +97,7 @@ int CountCharacters(WORD codePage, const char* text, const char* end) { int count = 0; while (*text != '\0' && (end == nullptr || text < end)) { text = CharNextExA(codePage, text, 0); - if (end != nullptr && text > end) { + if (end != nullptr && end < text) { break; } ++count;