diff --git a/src/rcheevos/rc_validate.c b/src/rcheevos/rc_validate.c index 52d50a81..af6d8cfc 100644 --- a/src/rcheevos/rc_validate.c +++ b/src/rcheevos/rc_validate.c @@ -789,12 +789,15 @@ static int rc_condset_has_hittargets(const rc_condset_t* condset) /* pause and reset conditions may have hittargets and won't be classified as hittarget conditions. * measured conditions may also have hittargets. + * other conditions may have hittarget conditions in an AndNext/OrNext chain. + * basically, check everything other than hittarget (explicitly known) and indirect (cannot have). */ - if (condset->num_pause_conditions || condset->num_reset_conditions || condset->num_measured_conditions) { + if (condset->num_pause_conditions || condset->num_reset_conditions || condset->num_measured_conditions || condset->num_other_conditions) { const rc_condition_t* condition = rc_condset_get_conditions((rc_condset_t*)condset); /* ASSERT: don't need to add num_hittarget_conditions because it must be 0 per earlier check */ const rc_condition_t* stop = condition + condset->num_pause_conditions - + condset->num_reset_conditions + condset->num_measured_conditions; + + condset->num_reset_conditions + condset->num_measured_conditions + + condset->num_other_conditions; for (; condition < stop; ++condition) { if (condition->required_hits) return 1; diff --git a/test/rcheevos/test_rc_validate.c b/test/rcheevos/test_rc_validate.c index aa1b98d3..53101749 100644 --- a/test/rcheevos/test_rc_validate.c +++ b/test/rcheevos/test_rc_validate.c @@ -435,14 +435,15 @@ void test_redundant_conditions() { TEST_PARAMS2(test_validate_trigger, "0xH0001=7.1._R:0xH0000=0_T:0xH0000=1", ""); } -void test_redundant_hitcounts() { +void test_resetif_hittargets() { TEST_PARAMS2(test_validate_trigger, "R:0xH0000!=0", "Condition 1: No captured hits to reset"); TEST_PARAMS2(test_validate_trigger, "R:0xH0000!=0_0xH0001=1.1.", ""); TEST_PARAMS2(test_validate_trigger, "R:0xH0000!=0_M:0xH0001=1.1.", ""); TEST_PARAMS2(test_validate_trigger, "R:0xH0000!=0.1._0xH0001=1.1.", "Condition 1: Hit target of 1 is redundant on ResetIf"); TEST_PARAMS2(test_validate_trigger, "R:0xH0000!=0.2._0xH0001=1.1.", ""); - TEST_PARAMS2(test_validate_trigger, "I:0xG1234&536870911_R:0xG0000=4294967294_0xH2222=1.1.", ""); + TEST_PARAMS2(test_validate_trigger, "N:0xH0001=4.1._T:0xH0001=5_R:0xH0001<2", ""); + TEST_PARAMS2(test_validate_trigger, "R:0xH0000!=0S0xH0001=1.1.S0xH0002=1", ""); } void test_variable_operand_errors() { @@ -490,7 +491,7 @@ void test_rc_validate(void) { test_dependent_conditions(); test_conflicting_conditions(); test_redundant_conditions(); - test_redundant_hitcounts(); + test_resetif_hittargets(); test_variable_operand_errors(); test_remember_recall_errors(); test_error_priorities();