Encapsulate object-state state tests and setttings in macros.
This isn't a complete refwctoring, just the part than can be done with transparetly correct capture of inlinre logic into macros. No logic changes. Tests pass, 100% coverage.
This commit is contained in:
parent
9cd7c53d78
commit
02987d0330
7 changed files with 32 additions and 25 deletions
2
init.c
2
init.c
|
@ -90,7 +90,7 @@ int initialise(void)
|
|||
for (int treasure = 1; treasure <= NOBJECTS; treasure++) {
|
||||
if (objects[treasure].is_treasure) {
|
||||
if (objects[treasure].inventory != 0)
|
||||
game.objects[treasure].prop = STATE_NOTFOUND;
|
||||
PROP_SET_NOT_FOUND(treasure);
|
||||
game.tally = game.tally - game.objects[treasure].prop;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue