The end of every rulebook routine has a couple of lines like the following:
...
latest_rule_result-->0 = 0;
return 0; ! 4 rule(s)
];
The intent seems to be to set latest_rule_result-->0
to RS_NEITHER
if no rule in the rulebook has made a decision.
However, routine FollowRulebook()
also has this block (after setting rv
to the value returned by the rulebook routine):
if (rv) {
#ifndef MEMORY_ECONOMY;
if (debugging_rules) {
process_rulebook_count = process_rulebook_count - debugging_rules;
if (process_rulebook_count < 0) process_rulebook_count = 0;
spaces(2*process_rulebook_count);
if (latest_rule_result-->0 == RS_SUCCEEDS) print "[stopped: success]^";
if (latest_rule_result-->0 == RS_FAILS) print "[stopped: fail]^";
}
#endif;
} else { ! <-- rv == 0
if (debugging_rules)
process_rulebook_count = process_rulebook_count - debugging_rules;
latest_rule_result-->0 = RS_NEITHER; ! <-- set latest_rule_result-->0 accordingly
}
It does not seem necessary to make this assignment in both places, and the ones in the rulebooks seem superfluous. Is there a reason to make the assignment at the end of every rulebook like this, or is it something vestigial from an earlier iteration of the rulebook system?