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
|
@ -229,8 +229,7 @@ bool is_valid(struct game_t valgame)
|
|||
|
||||
/* Check that properties of objects aren't beyond expected */
|
||||
for (obj_t obj = 0; obj <= NOBJECTS; obj++) {
|
||||
/* Magic number -2 allows a STASHED version of state 1 */
|
||||
if (valgame.objects[obj].prop < -2 || valgame.objects[obj].prop > 1) {
|
||||
if (PROP_IS_INVALID(valgame.objects[obj].prop)) {
|
||||
switch (obj) {
|
||||
case RUG:
|
||||
case DRAGON:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue