From f1fdc16676179c58bff565682afa989ee93e79b7 Mon Sep 17 00:00:00 2001 From: Darshan Shaligram Date: Mon, 4 Jan 2010 20:08:44 +0530 Subject: [Mantis 331] Fix inverted chunk-stacking logic that caused missiles of different brands to stack (syllogism). --- crawl-ref/source/items.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/items.cc') diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index f7aca1abb3..969b1afbac 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1304,9 +1304,11 @@ bool items_similar(const item_def &item1, const item_def &item2, bool ignore_ide { if (item1.plus != item2.plus || item1.plus2 != item2.plus2 - || (item1.base_type == OBJ_FOOD && item2.sub_type == FOOD_CHUNK) ? - (item1.special != item2.special) : - (abs(item1.special - item2.special) > 5)) + || ((item1.base_type == OBJ_FOOD && item2.sub_type == FOOD_CHUNK) ? + // Reject chunk merge if chunk ages differ by more than 5 + abs(item1.special - item2.special) > 5 + // Non-chunk item specials must match exactly. + : item1.special != item2.special)) { return (false); } -- cgit v1.2.3-54-g00ecf