Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001402 [DCSS] Bug Report minor always 2010-04-22 10:08 2012-09-13 22:01
Reporter Kate View Status public  
Assigned To neil
Priority normal Resolution done  
Status closed   Product Branch 0.7 ancient branch
Summary 0001402: Shopping list asks to remove manual when a different kind of manual is picked up
Description I had a manual of Necromancy on my shopping list and picked up a stack of books from my stash, containing a previously found manual of Throwing. Upon picking up the manual of Throwing, I was asked if I wanted to remove the manual of Necromancy from my shopping list. Pressing enter at this prompt resulted in: "The manual of Throwing isn't on shopping list, can't delete it."
Additional Information
Tags shopping list
Attached Files ? file icon 0001-Address-cull_identical_items-and-find_thing-issues-f.patch [^] (4,804 bytes) 2010-12-08 20:40 [Show Content]

- Relationships
has duplicate 0002167resolvedKate Incorrectly asked about replacing manual on shopping list 
related to 0003749resolvedneil Shopping list doesn't know the difference between a +5 ring of dex and a +3 ring of dex. 
related to 0004614resolvedneil Issues with auto-remove from shipping list 

-  Notes
(0009631)
ahpla (reporter)
2010-12-08 20:40
edited on: 2010-12-08 20:41

This and issue 0002167 are related. I've attached a patch which fixes both, but I have some notes below which should be considered due to my unfamiliarity with the code.

My investigations revealed that the bulk of the problem is caused by find_thing(), shopping.cc:2873, specifically:

if (pos != _pos)
    continue;

If I understand the code correctly, it doesn't makes sense to make such a comparison in the scenario MarvinPA experienced. In fact, I can't think of any time it would be useful, unless I'm missing something. As a result of this, the const bool on_list defined in cull_identical_items() at shopping.cc:2427 is always false in such a scenario, because find_thing() returns -1 every time.

Finally, a second separate issue in cull_identical_items(), shopping.cc:2518 is:

if (add_item && !on_list)
    add_thing(item, cost);

I'm not sure why it checks that the item is not already on the shopping list via on_list at this stage. After applying my fix, the cull_identical_items() function would not get as far as setting the add_item boolean if the item wasn't already on the shopping list (and before my fix, it would always be false anyway). My patch addresses this issue also.

(0011685)
smock (reporter)
2011-03-18 20:40

A similar error in 0.8.0-a0-5764 Windows tiles:

MESSAGE LOG:
Identify which item? (? for menu, Esc to quit)
As you read the scroll of identify, it crumbles to dust.
Shopping-list: remove a +0,+6 ring of slaying on D:11? (Y/n)
The uncursed ring of slaying isn't on shopping list, can't delete it.
r - a +1,+3 ring of slaying
(0011694)
KiloByte (manager)
2011-03-18 21:56

Even manuals of the same skill are not redundant.

A manual is a consumable that lasts only for a small number of uses. If you want to manual-dance a skill, you'll most likely want as many as you can.
(0017369)
neil (administrator)
2012-03-19 05:06
edited on: 2012-03-19 06:22

Fixed in trunk (af4ac7e and 8f855e2 to not prompt when inappropriate, and e45dc40 to correctly remove an item that differs from the new one).


- Issue History
Date Modified Username Field Change
2010-04-22 10:08 Kate New Issue
2010-05-13 15:21 rob Tag Attached: shopping list
2010-12-08 20:40 ahpla Note Added: 0009631
2010-12-08 20:40 ahpla File Added: 0001-Address-cull_identical_items-and-find_thing-issues-f.patch
2010-12-08 20:41 ahpla Note Edited: 0009631
2011-03-18 20:40 smock Note Added: 0011685
2011-03-18 21:56 KiloByte Note Added: 0011694
2011-05-11 21:33 Kate Issue Monitored: Kate
2011-11-10 23:23 Kate Issue End Monitor: Kate
2012-03-18 05:18 Kate Relationship added has duplicate 0003749
2012-03-18 05:19 Kate Relationship added has duplicate 0002167
2012-03-18 05:21 Kate Relationship deleted has duplicate 0003749
2012-03-18 05:21 Kate Relationship added related to 0003749
2012-03-18 05:23 Kate Relationship added related to 0004614
2012-03-19 05:06 neil Note Added: 0017369
2012-03-19 05:06 neil Status new => resolved
2012-03-19 05:06 neil Fixed in Branch => 0.11 development branch
2012-03-19 05:06 neil Resolution open => done
2012-03-19 05:06 neil Assigned To => neil
2012-03-19 06:22 neil Note Edited: 0017369
2012-09-13 22:01 Kate Status resolved => closed


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker