Merge pull request #910 from lioncash/bitwise

Core: Change a bitwise OR fail case to a logical AND success check in ActionReplay.cpp
This commit is contained in:
Lioncash 2014-08-30 15:19:49 -04:00
commit 265504bc23
1 changed files with 11 additions and 5 deletions

View File

@ -170,14 +170,20 @@ void LoadCodes(const IniFile& globalIni, const IniFile& localIni, bool forceLoad
AREntry op; AREntry op;
bool success_addr = TryParse(std::string("0x") + pieces[0], &op.cmd_addr); bool success_addr = TryParse(std::string("0x") + pieces[0], &op.cmd_addr);
bool success_val = TryParse(std::string("0x") + pieces[1], &op.value); bool success_val = TryParse(std::string("0x") + pieces[1], &op.value);
if (!(success_addr | success_val)) {
PanicAlertT("Action Replay Error: invalid AR code line: %s", line.c_str()); if (success_addr && success_val)
if (!success_addr) PanicAlertT("The address is invalid"); {
if (!success_val) PanicAlertT("The value is invalid"); currentCode.ops.push_back(op);
} }
else else
{ {
currentCode.ops.push_back(op); PanicAlertT("Action Replay Error: invalid AR code line: %s", line.c_str());
if (!success_addr)
PanicAlertT("The address is invalid");
if (!success_val)
PanicAlertT("The value is invalid");
} }
} }
else else