]> granicus.if.org Git - nethack/commitdiff
B01002 - tame dwarf won't eat
authorcohrs <cohrs>
Mon, 24 Mar 2003 07:30:49 +0000 (07:30 +0000)
committercohrs <cohrs>
Mon, 24 Mar 2003 07:30:49 +0000 (07:30 +0000)
<Someone> reported that a tame dwarf wouldn't eat food tossed at it.
He also reported that it wouldn't eat off the ground, which I couldn't
reproduce nor see in a problem in the code.  The code in thitmonst didn't
allow for sharing food with non-domestic, already tame monsters.

doc/fixes34.2
src/dothrow.c

index c154fba7926e2316a3ef438be944ab83a841e53e..d7eab1373e0fe6ed6124ef6aa45589bd693e626f 100644 (file)
@@ -27,6 +27,7 @@ Perseus statue should always be male
 charge correctly when breaking multiple objects with the same zap, avoids
        a dopay: not to shopkeeper impossible
 clean up funny lighting on the healer locate level
+allow all tame monsters that eat to consider food thrown to them
 
 
 Platform- and/or Interface-Specific Fixes
index 7a3f109c6cb8e255341b06fb2ff4d9f2659a5efd..f2f7a2734a3ac6d2f793b6c61c2289bd591489b1 100644 (file)
@@ -5,6 +5,7 @@
 /* Contains code for 't' (throw) */
 
 #include "hack.h"
+#include "edog.h"
 
 STATIC_DCL int FDECL(throw_obj, (struct obj *,int));
 STATIC_DCL void NDECL(autoquiver);
@@ -1346,7 +1347,8 @@ register struct obj   *obj;
            potionhit(mon, obj, TRUE);
            return 1;
 
-       } else if (befriend_with_obj(mon->data, obj)) {
+       } else if (befriend_with_obj(mon->data, obj) ||
+                  (mon->mtame && dogfood(mon, obj) <= ACCFOOD)) {
            if (tamedog(mon, obj))
                return 1;               /* obj is gone */
            else {