projects
/
open-adventure.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Unspk'd find
[open-adventure.git]
/
actions.c
diff --git
a/actions.c
b/actions.c
index 4099b22aec39bb283da5d8c1fe7ce5f7bb5bcd14..1c52d28f9c2bfeb741960290162ef5d17fa27701 100644
(file)
--- a/
actions.c
+++ b/
actions.c
@@
-725,17
+725,26
@@
int fill(token_t verb, token_t obj)
static int find(token_t verb, token_t obj)
/* Find. Might be carrying it, or it might be here. Else give caveat. */
{
static int find(token_t verb, token_t obj)
/* Find. Might be carrying it, or it might be here. Else give caveat. */
{
- int spk = actions[verb].message;
+ if (TOTING(obj)) {
+ rspeak(ALREADY_CARRYING);
+ return GO_CLEAROBJ;
+ }
+
+ if (game.closed) {
+ rspeak(NEEDED_NEARBY);
+ return GO_CLEAROBJ;
+ }
+
if (AT(obj) ||
(LIQUID() == obj && AT(BOTTLE)) ||
obj == LIQLOC(game.loc) ||
if (AT(obj) ||
(LIQUID() == obj && AT(BOTTLE)) ||
obj == LIQLOC(game.loc) ||
- (obj == DWARF && atdwrf(game.loc) > 0))
-
spk = YOU_HAVEIT
;
- if (game.closed)
- spk = NEEDED_NEARBY;
- if (TOTING(obj))
- spk = ALREADY_CARRYING;
- rspeak(
spk
);
+ (obj == DWARF && atdwrf(game.loc) > 0))
{
+
rspeak(YOU_HAVEIT)
;
+ return GO_CLEAROBJ;
+ }
+
+
+ rspeak(
actions[verb].message
);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}
@@
-778,19
+787,21
@@
static int fly(token_t verb, token_t obj)
static int inven(void)
/* Inventory. If object, treat same as find. Else report on current burden. */
{
static int inven(void)
/* Inventory. If object, treat same as find. Else report on current burden. */
{
-
int spk = NO_CARRY
;
+
bool empty = true
;
for (int i = 1; i <= NOBJECTS; i++) {
if (i == BEAR ||
!TOTING(i))
continue;
for (int i = 1; i <= NOBJECTS; i++) {
if (i == BEAR ||
!TOTING(i))
continue;
- if (
spk == NO_CARRY)
+ if (
empty) {
rspeak(NOW_HOLDING);
rspeak(NOW_HOLDING);
+ empty = false;
+ }
pspeak(i, touch, -1, false);
pspeak(i, touch, -1, false);
- spk = NO_MESSAGE;
}
if (TOTING(BEAR))
}
if (TOTING(BEAR))
- spk = TAME_BEAR;
- rspeak(spk);
+ rspeak(TAME_BEAR);
+ if (empty)
+ rspeak(NO_CARRY);
return GO_CLEAROBJ;
}
return GO_CLEAROBJ;
}