Magic-number elimination.
This commit is contained in:
parent
fd57b3b5bd
commit
7be7ac9406
2 changed files with 8 additions and 2 deletions
|
@ -889,8 +889,7 @@ static int listen(void)
|
||||||
long packed_zzword = token_to_packed(game.zzword);
|
long packed_zzword = token_to_packed(game.zzword);
|
||||||
pspeak(i, hear, mi, true, packed_zzword);
|
pspeak(i, hear, mi, true, packed_zzword);
|
||||||
rspeak(NO_MESSAGE);
|
rspeak(NO_MESSAGE);
|
||||||
/* FIXME: Magic number, sensitive to bird state logic */
|
if (i == BIRD && mi == BIRD_ENDSTATE)
|
||||||
if (i == BIRD && game.prop[i] == 5)
|
|
||||||
DESTROY(BIRD);
|
DESTROY(BIRD);
|
||||||
return GO_CLEAROBJ;
|
return GO_CLEAROBJ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,6 +192,8 @@ extern const char *ignore;
|
||||||
#define NTRAVEL {}
|
#define NTRAVEL {}
|
||||||
#define NKEYS {}
|
#define NKEYS {}
|
||||||
|
|
||||||
|
#define BIRD_ENDSTATE {}
|
||||||
|
|
||||||
enum arbitrary_messages_refs {{
|
enum arbitrary_messages_refs {{
|
||||||
{}
|
{}
|
||||||
}};
|
}};
|
||||||
|
@ -768,6 +770,10 @@ if __name__ == "__main__":
|
||||||
ignore,
|
ignore,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# 0-origin index of birds's last song. Bird should
|
||||||
|
# die after player hears this.
|
||||||
|
deathbird = len(dict(db["objects"])["BIRD"]["sounds"]) - 1
|
||||||
|
|
||||||
h = h_template.format(
|
h = h_template.format(
|
||||||
len(db["locations"])-1,
|
len(db["locations"])-1,
|
||||||
len(db["objects"])-1,
|
len(db["objects"])-1,
|
||||||
|
@ -780,6 +786,7 @@ if __name__ == "__main__":
|
||||||
len(db["specials"]),
|
len(db["specials"]),
|
||||||
len(travel),
|
len(travel),
|
||||||
len(tkey),
|
len(tkey),
|
||||||
|
deathbird,
|
||||||
get_refs(db["arbitrary_messages"]),
|
get_refs(db["arbitrary_messages"]),
|
||||||
get_refs(db["locations"]),
|
get_refs(db["locations"]),
|
||||||
get_refs(db["objects"]),
|
get_refs(db["objects"]),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue