Changeset 360

Show
Ignore:
Timestamp:
07/19/07 15:37:04 (1 year ago)
Author:
ajps
Message:

Make 'Glyph of Warding' 'shove' items out of the way when created on a spot. Closes #248

Files:

Legend:

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

    r344 r360  
    7878void warding_glyph(void) 
    7979{ 
     80        object_type *o_ptr; 
    8081        int py = p_ptr->py; 
    8182        int px = p_ptr->px; 
    8283 
    83         /* XXX XXX XXX */ 
    84         if (!cave_clean_bold(py, px)) 
    85         { 
    86                 msg_print("The object resists the spell."); 
     84        if (cave_feat[py][px] != FEAT_FLOOR) 
     85        { 
     86                msg_print("There is no clear floor on which to cast the spell."); 
    8787                return; 
    8888        } 
     
    9090        /* Create a glyph */ 
    9191        cave_set_feat(py, px, FEAT_GLYPH); 
     92 
     93        /* Shift any objects to further away */ 
     94        for (o_ptr = get_first_object(py, px); o_ptr; o_ptr = get_next_object(o_ptr)) 
     95        { 
     96                drop_near(o_ptr, 0, py, px); 
     97        } 
     98 
     99        /* Delete the "moved" objects from their original position */ 
     100        delete_object(py, px); 
    92101} 
    93102