projects
/
open-adventure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3f90f5b
)
Remove special-case code that was inducing bugs.
author
Eric S. Raymond
<esr@thyrsus.com>
Thu, 20 Jul 2017 13:08:10 +0000
(09:08 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Thu, 20 Jul 2017 13:08:10 +0000
(09:08 -0400)
actions.c
patch
|
blob
|
history
main.c
patch
|
blob
|
history
diff --git
a/actions.c
b/actions.c
index 83177d4ad666cdec551f77021c5792811bda8098..209d257658ba3766d463487234a4ee28a4e8df47 100644
(file)
--- a/
actions.c
+++ b/
actions.c
@@
-1145,15
+1145,11
@@
static int rub(verb_t verb, obj_t obj)
static int say(struct command_t *command)
/* Say. Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).) Magic words override. */
{
static int say(struct command_t *command)
/* Say. Echo WD2 (or WD1 if no WD2 (SAY WHAT?, etc.).) Magic words override. */
{
- if (command->raw2 != '\0') {
- command->wd1 = command->wd2;
- strncpy(command->raw1, command->raw2, LINESIZE - 1);
- }
- char word1[TOKLEN + 1];
- packed_to_token(command->wd1, word1);
+ char word2[TOKLEN + 1];
+ packed_to_token(command->wd2, word2);
long wd;
enum wordtype type;
long wd;
enum wordtype type;
- get_vocab_metadata(word
1
, &wd, &type);
+ get_vocab_metadata(word
2
, &wd, &type);
if (wd == XYZZY ||
wd == PLUGH ||
wd == PLOVER ||
if (wd == XYZZY ||
wd == PLUGH ||
wd == PLOVER ||
@@
-1163,11
+1159,9
@@
static int say(struct command_t *command)
wd == FOO ||
wd == FUM ||
wd == PART) {
wd == FOO ||
wd == FUM ||
wd == PART) {
- /* FIXME: scribbles on the interpreter's command block */
- wordclear(&command->wd2);
- return GO_LOOKUP;
+ return GO_WORD2;
}
}
- sspeak(OKEY_DOKEY, command->raw
1
);
+ sspeak(OKEY_DOKEY, command->raw
2
);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
diff --git
a/main.c
b/main.c
index 66f63f993dc32a845689dd817851acd570a9dcb7..1a1f25d63bf90f02ae97554860138ddc12159bdb 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-1130,16
+1130,7
@@
Lclearobj:
goto Lclearobj;
}
goto Lclearobj;
}
- /* Ugly translationms to get around word polyvalence. */
- if (command.type1 == ACTION && command.id1 == SAY
- && command.id2 != WORD_NOT_FOUND && command.id2 != WORD_EMPTY) {
- command.id1 = command.id2;
- command.type1 = command.type2;
- strncpy(command.raw1, command.raw2, LINESIZE - 1);
- command.id2 = WORD_EMPTY;
- command.type2 = NO_WORD_TYPE;
- strncpy(command.raw2, "", LINESIZE - 1);
- } else if (command.type1 == OBJECT) {
+ if (command.type1 == OBJECT) {
if (!((command.id1 != WATER && command.id1 != OIL) || (command.id2 != PLANT && command.id2 != DOOR))) {
if (AT(command.id2)) {
command.id2 = POUR;
if (!((command.id1 != WATER && command.id1 != OIL) || (command.id2 != PLANT && command.id2 != DOOR))) {
if (AT(command.id2)) {
command.id2 = POUR;
@@
-1204,8
+1195,6
@@
Lookup:
return true;
case GO_TOP:
continue; /* back to top of main interpreter loop */
return true;
case GO_TOP:
continue; /* back to top of main interpreter loop */
- case GO_LOOKUP:
- goto Lookup;
case GO_WORD2:
/* Get second word for analysis. */
command.id1 = command.id2;
case GO_WORD2:
/* Get second word for analysis. */
command.id1 = command.id2;