projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Magic-number elimination.
[open-adventure.git]
/
main.c
diff --git
a/main.c
b/main.c
index 0719e8ceea7ce2efb3b1f3073e437a8549b9bf0b..2ba9dda3d4a6a52ead0e6f833c6d358ded07b64f 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-1037,11
+1037,11
@@
static bool do_command()
listobjects();
Lclearobj:
listobjects();
Lclearobj:
- command.verb =
0
;
+ command.verb =
ACT_NULL
;
game.oldobj = command.obj;
game.oldobj = command.obj;
- command.obj =
0
;
+ command.obj =
NO_OBJECT
;
-L
2600
:
+L
checkhint
:
checkhints();
/* If closing time, check for any objects being toted with
checkhints();
/* If closing time, check for any objects being toted with
@@
-1185,9
+1185,6
@@
Lookup:
default: // LCOV_EXCL_LINE
BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE
}
default: // LCOV_EXCL_LINE
BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE
}
- if (!is_valid(game)) {
- exit(1);
- }
switch (action(command)) {
case GO_TERMINATE:
return true;
switch (action(command)) {
case GO_TERMINATE:
return true;
@@
-1199,11
+1196,7
@@
Lookup:
case GO_CLEAROBJ:
goto Lclearobj;
case GO_CHECKHINT:
case GO_CLEAROBJ:
goto Lclearobj;
case GO_CHECKHINT:
- goto L2600;
- case GO_CHECKFOO:
- goto Lclosecheck;
- case GO_LOOKUP:
- goto Lookup;
+ goto Lcheckhint;
case GO_WORD2:
#ifdef GDEBUG
printf("Word shift\n");
case GO_WORD2:
#ifdef GDEBUG
printf("Word shift\n");
@@
-1218,7
+1211,7
@@
Lookup:
command.word[0].raw[0] = toupper(command.word[0].raw[0]);
sspeak(DO_WHAT, command.word[0].raw);
command.obj = 0;
command.word[0].raw[0] = toupper(command.word[0].raw[0]);
sspeak(DO_WHAT, command.word[0].raw);
command.obj = 0;
- goto L
2600
;
+ goto L
checkhint
;
case GO_DWARFWAKE:
/* Oh dear, he's disturbed the dwarves. */
rspeak(DWARVES_AWAKEN);
case GO_DWARFWAKE:
/* Oh dear, he's disturbed the dwarves. */
rspeak(DWARVES_AWAKEN);