diff --git a/amxmodx/textparse.h b/amxmodx/textparse.h index 93d3ffc9..0d844f30 100644 --- a/amxmodx/textparse.h +++ b/amxmodx/textparse.h @@ -101,7 +101,7 @@ public: bool ReadINI_NewSection(const char *section, bool invalid_tokens, bool close_bracket, bool extra_tokens, unsigned int *curtok) { if (new_section != -1) - return executeForwards(new_section, handle, section, invalid_tokens, close_bracket, extra_tokens, *curtok) > 0 ? false : true; + return executeForwards(new_section, handle, section, invalid_tokens, close_bracket, extra_tokens, *curtok) > 0 ? true : false; return true; } @@ -109,7 +109,7 @@ public: bool ReadINI_KeyValue(const char *key, const char *value, bool invalid_tokens, bool equal_token, bool quotes, unsigned int *curtok) { if (key_value != -1) - return executeForwards(key_value, handle, key, value, invalid_tokens, equal_token, quotes, *curtok) > 0 ? false : true; + return executeForwards(key_value, handle, key, value, invalid_tokens, equal_token, quotes, *curtok) > 0 ? true : false; return true; } @@ -117,7 +117,7 @@ public: bool ReadINI_RawLine(const char *line, unsigned int *curtok) { if (raw_line != -1) - return executeForwards(raw_line, handle, line, *curtok) > 0 ? false : true; + return executeForwards(raw_line, handle, line, *curtok) > 0 ? true : false; return true; } diff --git a/plugins/testsuite/textparse_test.sma b/plugins/testsuite/textparse_test.sma index 92f54912..64e6ce82 100644 --- a/plugins/testsuite/textparse_test.sma +++ b/plugins/testsuite/textparse_test.sma @@ -212,33 +212,38 @@ public ReadCSDM_NewSection(INIParser:handle, const section[], bool:invalid_token if ((equal(section, "secondary") && !extra_tokens) || (equal(section, "botsecondary") && close_bracket)) { - return; + return true; } ++SuccessCount; } + + return true; } -public ReadCSDM_KeyValue(INIParser:handle, const key[], const value[], bool:invalid_tokens, bool:equal_token, bool:quotes, curtok) +public bool:ReadCSDM_KeyValue(INIParser:handle, const key[], const value[], bool:invalid_tokens, bool:equal_token, bool:quotes, curtok) { Debug && server_print("^t^tReadCSDM_KeyValue - %-32s %s", key, value); new buffer[128]; if (TrieGetString(ExpectedKVData, key, buffer, charsmax(buffer)) && equal(value, buffer)) { - if (equal(value, "colors") && !quotes) + if (equal(key, "colors") && !quotes) { - return; + return true; } ++SuccessCount; } + + return true; } -public ReadCSDM_CurrentLine(INIParser:handle, const line[], curtok) +public bool:ReadCSDM_CurrentLine(INIParser:handle, const line[], curtok) { //Debug && server_print("^t^tReadCSDM_CurrentLine - %s", line); ++SuccessCount; + return true; } public ReadCSDM_ParseEnd(INIParser:handle, bool:halted, bool:failed)