From 16ad2bd0b85ef63cc83759ffeeb40cef90797811 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 19 Jul 2007 07:02:46 +0000 Subject: [PATCH] treasure drop drop (trunk only) From the newsgroup: objects created when killing a monster over water weren't being affected by falling into the water. The objects were being created directly on the floor instead of being dropped as if they'd been in the monster's inventory. This fixes the random "treasure drop" item, but special items--like dragon scales and the miscellaneous golem remains--produced by make_corpse() are still put directly onto the floor. The check to prevent small monsters from dropping big objects was overly complex, possibly due to the 3.1.x weight threshold bug which was just recently fixed. Food rations and leashes pass the weight test so don't need to be special cased; spears, polearms, and morning stars fail the weight test. (Javelins are an exception; they pass the weight test so are allowed to be dropped by small monsters now since spears aren't special cased any more.) --- doc/fixes35.0 | 1 + src/mon.c | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 721097c2e..72f846472 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -259,6 +259,7 @@ can't move diagonally through a long worm's body (can still fight that way) require confirmation to read a scroll of mail if doing so will be the first violation of illiteracy conduct using F to force an attack towards a boulder gave "you attack thin air" +random "treasure drop" upon monster's death bypassed dropping side-effects Platform- and/or Interface-Specific Fixes diff --git a/src/mon.c b/src/mon.c index bfe8ed5cc..a6ea49a7d 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2027,16 +2027,17 @@ int dest; #endif /* reduced chance of item from cloned monster */ (!mtmp->mcloned || !rn2(mvitals[mndx].died / 5 + 1))) { - otmp = mkobj_at(RANDOM_CLASS, x, y, TRUE); + otmp = mkobj(RANDOM_CLASS, TRUE); /* don't create large objects from small monsters */ otyp = otmp->otyp; - if (mdat->msize < MZ_HUMAN && otyp != FOOD_RATION && - otyp != LEASH && otyp != FIGURINE && - (otmp->owt > 30 || - objects[otyp].oc_big /*oc_bimanual/oc_bulky*/ || - is_spear(otmp) || is_pole(otmp) || - otyp == MORNING_STAR)) { + if (mdat->msize < MZ_HUMAN && otyp != FIGURINE && + /* oc_big is also oc_bimanual and oc_bulky */ + (otmp->owt > 30 || objects[otyp].oc_big)) { delobj(otmp); + } else if (!flooreffects(otmp, x, y, + (dest & 1) ? "fall" : "")) { + place_object(otmp, x, y); + stackobj(otmp); } } /* corpse--none if hero was inside the monster */