Changeset 376

Show
Ignore:
Timestamp:
07/27/07 11:42:49 (1 year ago)
Author:
takkaria
Message:

Fix TR3_LITE flag behaviour on non-lights. (see #260)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/angband-3.0.8/src/xtra1.c

    r265 r376  
    16651665 
    16661666        s16b old_lite = p_ptr->cur_lite; 
     1667        bool burn_light = TRUE; 
     1668 
    16671669        s16b new_lite = 0; 
    1668         bool burn_light = TRUE; 
     1670        int extra_lite = 0; 
     1671 
    16691672 
    16701673 
     
    16881691                object_flags(o_ptr, &f1, &f2, &f3); 
    16891692 
    1690                 /* LITE flag on an object always increases radius */ 
    1691                 if (f3 & TR3_LITE) amt++; 
    1692  
    16931693                /* Cursed objects emit no light */ 
    16941694                if (o_ptr->ident & IDENT_CURSED) 
     
    17001700                else if (o_ptr->tval == TV_LITE) 
    17011701                { 
     1702                        int flag_inc = (f3 & TR3_LITE) ? 1 : 0; 
     1703 
    17021704                        /* Artifact Lites provide permanent bright light */ 
    17031705                        if (artifact_p(o_ptr)) 
    1704                                 amt += 3
     1706                                amt = 3 + flag_inc
    17051707 
    17061708                        /* Non-artifact lights and those without fuel provide no light */ 
    17071709                        else if (!burn_light || o_ptr->timeout == 0) 
    1708                             amt = 0; 
     1710                               amt = 0; 
    17091711 
    17101712                        /* All lit lights provide at least radius 2 light */ 
    17111713                        else 
    17121714                        { 
    1713                                 amt += 2
     1715                                amt = 2 + flag_inc
    17141716 
    17151717                                /* Torches below half fuel provide less light */ 
     
    17191721                } 
    17201722 
     1723                else 
     1724                { 
     1725                        /* LITE flag on an non-cursed non-lights always increases radius */ 
     1726                        if (f3 & TR3_LITE) extra_lite++; 
     1727                } 
     1728 
    17211729                /* Alter p_ptr->cur_lite if reasonable */ 
    17221730                if (new_lite < amt) 
     
    17241732        } 
    17251733 
    1726         /* Limit light radius (paranoia) */ 
    1727         new_lite = MIN(new_lite, 4); 
     1734        /* Add bonus from LITE flags */ 
     1735        new_lite += extra_lite; 
     1736 
     1737        /* Limit light */ 
     1738        new_lite = MIN(new_lite, 5); 
    17281739        new_lite = MAX(new_lite, 0); 
    17291740