Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0009477 [DCSS] Bug Report minor have not tried 2015-02-09 19:14 2015-02-09 22:16
Reporter Siegurt View Status public  
Assigned To elliptic
Priority normal Resolution done  
Status closed   Product Branch 0.16 ancient branch
Summary 0009477: _resist_mutation is checked twice making rMut much less effective
Description In commit c49590a9 mutation resistance was refactored out into it's own fuction _resist_mutation()

However when doing so the code was changed from:
if (!god_gift)
        {
            if ((you.rmut_from_item()
                 && !one_chance_in(temporary ? 3 : 10) && !beneficial)
                || player_mutation_level(MUT_MUTATION_RESISTANCE) == 3
                || (player_mutation_level(MUT_MUTATION_RESISTANCE)
                    && !one_chance_in(temporary ? 2 : 3)))
            {
                if (failMsg)
                    mprf(MSGCH_MUTATION, "You feel odd for a moment.");
                return false;

to:
if (!god_gift && _resist_mutation(mutclass, beneficial))
        {
            if (_resist_mutation(mutclass, beneficial))
            {
                if (failMsg)
                    mprf(MSGCH_MUTATION, "You feel odd for a moment.");
                return false;

As you can see, it checks _resist_mutation twice here, which means if something has a 90% chance of passing once, it has an 81% chance of passing both, if it's got a 66% chance of passing once, it's got a 43% chance of passing twice etc.

This is confusing and misleading, as well as duplicated code, if the intention was to reduce the resistance chances of the items it should just use new values and check once (which it doesn't appear to be, it appears to be just a bug, I would guess from a bad merge, at least there's no mention of intentionally changing resist mutation chances in the commit notes.)
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0028454)
PleasingFungus (administrator)
2015-02-09 20:02

Checking the logs, we found this bug on 10/30/2014, agreed that the inner _resist_mutation() check should be removed, and then presumably each assumed that the other person in the conversation was going to actually make the fix.
(0028455)
elliptic (developer)
2015-02-09 20:19

Fixed, thanks!
(0028460)
Siegurt (reporter)
2015-02-09 22:16

Yay for quick turnaround times :)

- Issue History
Date Modified Username Field Change
2015-02-09 19:14 Siegurt New Issue
2015-02-09 20:02 PleasingFungus Note Added: 0028454
2015-02-09 20:19 elliptic Note Added: 0028455
2015-02-09 20:19 elliptic Status new => resolved
2015-02-09 20:19 elliptic Fixed in Branch => 0.16 development branch
2015-02-09 20:19 elliptic Resolution open => done
2015-02-09 20:19 elliptic Assigned To => elliptic
2015-02-09 22:16 Siegurt Note Added: 0028460
2015-02-09 22:16 Siegurt Status resolved => closed


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