Merge pull request #7311 from Bigpet/master

cwcheat: log a warning trying to skip past the end
This commit is contained in:
Unknown W. Brackets committed 2015-01-10 14:25:35 -08:00
commit 59b1027f3e
1 file changed
+7 -1
+7 -1
View File
@@ -206,7 +206,13 @@ std::vector<int> CWCheatEngine::GetNextCode() { // Feeds a size-2 vector of ints
void CWCheatEngine::SkipCodes(int count) {
for (int i = 0; i < count; i ++) {
if (GetNextCode()[0] == 0) {
auto code = GetNextCode();
if (code.empty())
{
WARN_LOG(COMMON, "CWCHEAT: Tried to skip more codes than there are, the cheat is most likely wrong");
break;
}
if (code[0] == 0) {
break;
}
}