From 10f3d90f83ad1cd202f13df5108995821a97c29d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 2 Mar 2014 22:11:42 -0500 Subject: [PATCH] Make the base calculation in CheatsWindow simpler. First and foremost this should test the checked state, not its direct value. This should never have used multiplication at all. Seriously, what the hell? The only values it would have given is true or false, so the only cases are 0*6 and 1*6. --- Source/Core/DolphinWX/CheatsWindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/CheatsWindow.cpp b/Source/Core/DolphinWX/CheatsWindow.cpp index 4318fb912c..79325d7b3c 100644 --- a/Source/Core/DolphinWX/CheatsWindow.cpp +++ b/Source/Core/DolphinWX/CheatsWindow.cpp @@ -647,7 +647,8 @@ void CreateCodeDialog::PressOK(wxCommandEvent& ev) } long code_value; - if (!textctrl_value->GetValue().ToLong(&code_value, 10 + checkbox_use_hex->GetValue()*6)) + int base = checkbox_use_hex->IsChecked() ? 16 : 10; + if (!textctrl_value->GetValue().ToLong(&code_value, base)) { PanicAlertT("Invalid Value!"); return;