Changeset 796

Show
Ignore:
Timestamp:
03/19/08 15:27:14 (5 months ago)
Author:
GabeCunningham
Message:

Fix #409: Reading a Scroll of Rune of Protection off the floor now correctly deletes the scroll and makes you aware of the item flavor.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/cmd6.c

    r755 r796  
    120120        bool was_aware = object_aware_p(o_ptr); 
    121121        int dir = 5; 
     122        int px = p_ptr->px, py = p_ptr->py; 
    122123 
    123124        /* Figure out effect to use */ 
     
    197198        } 
    198199 
    199  
    200         /* Some uses are "free" */ 
    201         if (!used) return; 
    202  
    203200        /* Chargeables act differently to single-used items when not used up */ 
    204         if (use == USE_CHARGE) 
     201        if (used && use == USE_CHARGE) 
    205202        { 
    206203                /* Use a single charge */ 
     
    213210                        floor_item_charges(0 - item); 
    214211        } 
    215         else if (use == USE_TIMEOUT) 
     212        else if (used && use == USE_TIMEOUT) 
    216213        { 
    217214                /* Artifacts use their own special field */ 
     
    227224                } 
    228225        } 
    229         else if (use == USE_SINGLE) 
     226        else if (used && use == USE_SINGLE) 
    230227        { 
    231228                /* Destroy a potion in the pack */ 
     
    245242                } 
    246243        } 
     244         
     245        /* Hack to make Glyph of Warding work properly */ 
     246        if (cave_feat[py][px] == FEAT_GLYPH) 
     247        { 
     248                /* Shift any objects to further away */ 
     249                for (o_ptr = get_first_object(py, px); o_ptr; o_ptr = get_next_object(o_ptr)) 
     250                { 
     251                        drop_near(o_ptr, 0, py, px); 
     252                } 
     253                 
     254                /* Delete the "moved" objects from their original position */ 
     255                delete_object(py, px); 
     256        } 
     257 
     258         
    247259} 
  • trunk/src/spells2.c

    r789 r796  
    9898void warding_glyph(void) 
    9999{ 
    100         object_type *o_ptr; 
    101100        int py = p_ptr->py; 
    102101        int px = p_ptr->px; 
     
    110109        /* Create a glyph */ 
    111110        cave_set_feat(py, px, FEAT_GLYPH); 
    112  
    113         /* Shift any objects to further away */ 
    114         for (o_ptr = get_first_object(py, px); o_ptr; o_ptr = get_next_object(o_ptr)) 
    115         { 
    116                 drop_near(o_ptr, 0, py, px); 
    117         } 
    118  
    119         /* Delete the "moved" objects from their original position */ 
    120         delete_object(py, px); 
    121111} 
    122112