Anonymous | Login | 2024-03-29 06:20 CET |
Main | My View | View Issues | Change Log | Wiki | Tavern | News |
Viewing Issue Simple Details [ Jump to Notes ] [ Wiki ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||||||
0002360 | [DCSS] Bug Report | minor | random | 2010-08-24 05:29 | 2010-08-24 08:57 | ||||||||
Reporter | reid | View Status | public | ||||||||||
Assigned To | rob | ||||||||||||
Priority | normal | Resolution | done | ||||||||||
Status | resolved | Product Branch | 0.7 ancient branch | ||||||||||
Summary | 0002360: read past end of array in unrandart selection | ||||||||||||
Description |
get_unrand_specialness in artefact.cc contains the following code: if (unrand_index < UNRAND_START || unrand_index > UNRAND_LAST) return (UNRANDSPEC_NORMAL); if (unranddata[unrand_index].flags & UNRAND_FLAG_SPECIAL) return (UNRANDSPEC_SPECIAL); The condition of the second if is wrong; unrand_index = UNRAND_START corresponds to element 0 of the unranddata array. "unranddata[unrand_index]" should be replaced by "unranddata[unrand_index - UNRAND_START]". This can plausibly explain the recent odd unrand generation on CAO and CDO. If, for example, the only special unrand armour according to the above code happens to be salamander leather hide, then whenever _try_make_armour_artefact calls _try_make_item_special_unrand, salamander hide armour will be generated, which could be significantly more often than any other particular unrand is generated. |
||||||||||||
Additional Information | |||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files | |||||||||||||
|
Mantis 1.1.8[^] Copyright © 2000 - 2009 Mantis Group |