Support loud locations.
[open-adventure.git] / actions.c
index a17abdee82a7d5e6ce0899dd679c9c9191ba55d1..b6cfc33d0210328c7a2f7ed81c9fc180dfa229d6 100644 (file)
--- a/actions.c
+++ b/actions.c
@@ -671,13 +671,15 @@ static int light(token_t verb, token_t obj)
 static int listen(void)
 /*  Listen.  Intransitive only.  Print stuff based on objsnd/locsnd. */
 {
-    int k;
+    long k;
     int spk = ALL_SILENT;
-    k = LOCSND[game.loc];
-    if (k != 0) {
-        rspeak(labs(k));
-        if (k < 0) return GO_CLEAROBJ;
-        spk = NO_MESSAGE;
+    k = locations[game.loc].sound;
+    if (k != SILENT) {
+        rspeak(k);
+        if (locations[game.loc].loud)
+           return GO_CLEAROBJ;
+       else
+           spk = NO_MESSAGE;
     }
     for (int i = 1; i <= NOBJECTS; i++) {
         if (!HERE(i) || OBJSND[i] == 0 || game.prop[i] < 0)