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:
5535c50
)
Localize K.
author
Eric S. Raymond
<esr@thyrsus.com>
Mon, 12 Jun 2017 10:13:00 +0000
(06:13 -0400)
committer
Eric S. Raymond
<esr@thyrsus.com>
Mon, 12 Jun 2017 10:13:00 +0000
(06:13 -0400)
TODO
patch
|
blob
|
history
main.c
patch
|
blob
|
history
diff --git
a/TODO
b/TODO
index 6abcb59866ad0c68ac07bac9f51b669acfa3d59f..218ca91a68841d75ee690b20fd5d188dbc0c3ed8 100644
(file)
--- a/
TODO
+++ b/
TODO
@@
-11,10
+11,6
@@
remain to be cleaned up:
in playermove() is particularly horrible, jumping backwards into the
middle of a loop.
in playermove() is particularly horrible, jumping backwards into the
middle of a loop.
-* In playermove(), why doesn't replacing the global motion number K
- with a passed-in argument work? There's some unobvious information
- leak here.
-
* The way return values from handlers such as 2012 trigger side effects
based on global state is nasty.
* The way return values from handlers such as 2012 trigger side effects
based on global state is nasty.
diff --git
a/main.c
b/main.c
index 2b831f2fe3ecd7662e6ac4c5e0d074023cedb5cf..8e78500a698731e812db9f3971838dd10bf1118b 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-492,9
+492,9
@@
static void croak(FILE *cmdin)
* him, so we need game.oldlc2, which is the last place he was
* safe.) */
* him, so we need game.oldlc2, which is the last place he was
* safe.) */
-static bool playermove(FILE *cmdin, token_t verb)
+static bool playermove(FILE *cmdin, token_t verb
, int motion
)
{
{
- int LL, K2, KK=KEY[game.loc]
, motion = K
;
+ int LL, K2, KK=KEY[game.loc];
game.newloc=game.loc;
if (KK == 0)
BUG(26);
game.newloc=game.loc;
if (KK == 0)
BUG(26);
@@
-1056,7
+1056,7
@@
Laction:
BUG(99);
/* Figure out the new location */
BUG(99);
/* Figure out the new location */
-L8: if (playermove(cmdin, VERB))
+L8: if (playermove(cmdin, VERB
, K
))
return true;
else
goto L2000;
return true;
else
goto L2000;