projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Eliminate unreachable code in lock()
[open-adventure.git]
/
actions.c
diff --git
a/actions.c
b/actions.c
index 51a3f599a6cddde9b9d7d590e7b5bfb70826b6b0..ad09b4a254f0b584cdbbdef5124aa53eb91705f0 100644
(file)
--- a/
actions.c
+++ b/
actions.c
@@
-528,7
+528,9
@@
static int extinguish(token_t verb, int obj)
obj = LAMP;
if (HERE(URN) && game.prop[URN] == URN_LIT)
obj = URN;
obj = LAMP;
if (HERE(URN) && game.prop[URN] == URN_LIT)
obj = URN;
- if (obj == INTRANSITIVE)
+ if (obj == INTRANSITIVE ||
+ HERE(LAMP) && game.prop[LAMP] == LAMP_BRIGHT &&
+ HERE(URN) && game.prop[URN] == URN_LIT)
return GO_UNKNOWN;
}
return GO_UNKNOWN;
}
@@
-739,7
+741,9
@@
static int light(token_t verb, token_t obj)
obj = LAMP;
if (HERE(URN) && game.prop[URN] == URN_DARK)
obj = URN;
obj = LAMP;
if (HERE(URN) && game.prop[URN] == URN_DARK)
obj = URN;
- if (obj == INTRANSITIVE || obj == 0 || obj > NOBJECTS)
+ if (obj == INTRANSITIVE ||
+ HERE(LAMP) && game.prop[LAMP] == LAMP_DARK && game.limit >= 0 &&
+ HERE(URN) && game.prop[URN] == URN_DARK)
return GO_UNKNOWN;
}
return GO_UNKNOWN;
}
@@
-807,8
+811,6
@@
static int lock(token_t verb, token_t obj)
obj = DOOR;
if (AT(GRATE))
obj = GRATE;
obj = DOOR;
if (AT(GRATE))
obj = GRATE;
- if (obj != 0 && HERE(CHAIN))
- return GO_UNKNOWN;
if (HERE(CHAIN))
obj = CHAIN;
if (obj == 0 || obj == INTRANSITIVE) {
if (HERE(CHAIN))
obj = CHAIN;
if (obj == 0 || obj == INTRANSITIVE) {