projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e1a528a
)
Magic-number elimination.
author
Eric S. Raymond
<esr@thyrsus.com>
Thu, 6 Apr 2023 14:03:24 +0000
(10:03 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Thu, 6 Apr 2023 14:03:24 +0000
(10:03 -0400)
main.c
patch
|
blob
|
history
saveresume.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index 124ba44105ead1eff413e4cef8ddd29e71972d84..80689e3f5c14f314fdd04c0b3dd4d51e1c1bdd8b 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-463,8
+463,7
@@
static void describe_location(void)
{
const char* msg = locations[game.loc].description.small;
{
const char* msg = locations[game.loc].description.small;
- if (MOD(game.abbrev[game.loc], game.abbnum) == 0 ||
- msg == NO_MESSAGE)
+ if (MOD(game.abbrev[game.loc], game.abbnum) == 0 || msg == NO_MESSAGE)
msg = locations[game.loc].description.big;
if (!FORCED(game.loc) && DARK(game.loc)) {
msg = locations[game.loc].description.big;
if (!FORCED(game.loc) && DARK(game.loc)) {
diff --git
a/saveresume.c
b/saveresume.c
index db1153b3c793bef7bb8bddc35ba55c236c98c5bb..d7fe76e5f3d9c79d69e87d57f9b1d082326d5ec0 100644
(file)
--- a/
saveresume.c
+++ b/
saveresume.c
@@
-29,8
+29,7
@@
/*
* If you change the first three members, the resume function may not properly
/*
* If you change the first three members, the resume function may not properly
- * reject saves from older versions. Yes, this glues us to a hardware-
- * dependent length of int. Later members can change, but bump the version
+ * reject saves from older versions. Later members can change, but bump the version
* when you do that.
*/
struct save_t {
* when you do that.
*/
struct save_t {
@@
-123,8
+122,7
@@
int resume(void)
#endif
FILE *fp = NULL;
#endif
FILE *fp = NULL;
- if (game.loc != 1 ||
- game.abbrev[1] != 1) {
+ if (game.loc != LOC_START || game.abbrev[LOC_START] != 1) {
rspeak(RESUME_ABANDON);
if (!yes_or_no(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN]))
return GO_CLEAROBJ;
rspeak(RESUME_ABANDON);
if (!yes_or_no(arbitrary_messages[THIS_ACCEPTABLE], arbitrary_messages[OK_MAN], arbitrary_messages[OK_MAN]))
return GO_CLEAROBJ;