Changeset 359

Show
Ignore:
Timestamp:
07/19/07 10:49:23 (1 year ago)
Author:
ajps
Message:

Move more inscription checks over to use check_for_inscrip

Files:

Legend:

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

    r352 r359  
    26322632static bool get_item_allow(int item) 
    26332633{ 
    2634         cptr s; 
    2635  
    26362634        object_type *o_ptr; 
     2635        char verify_inscrip[] = "!*"; 
    26372636 
    26382637        /* Inventory */ 
     
    26482647        } 
    26492648 
    2650         /* No inscription */ 
    2651         if (!o_ptr->note) return (TRUE); 
    2652  
    2653         /* Find a '!' */ 
    2654         s = strchr(quark_str(o_ptr->note), '!'); 
    2655  
    2656         /* Process preventions */ 
    2657         while (s) 
    2658         { 
    2659                 /* Check the "restriction" */ 
    2660                 if ((s[1] == p_ptr->command_cmd) || (s[1] == '*')) 
    2661                 { 
    2662                         /* Verify the choice */ 
    2663                         if (!verify_item("Really try", item)) return (FALSE); 
    2664                 } 
    2665  
    2666                 /* Find another '!' */ 
    2667                 s = strchr(s + 1, '!'); 
     2649        /* Check for a "prevention" inscription */ 
     2650        verify_inscrip[1] = p_ptr->command_cmd; 
     2651 
     2652        if (o_ptr->note && (check_for_inscrip(o_ptr, "!*") ||  
     2653                            check_for_inscrip(o_ptr, verify_inscrip))) 
     2654        { 
     2655                /* Verify the choice */ 
     2656                if (!verify_item("Really try", item)) return (FALSE); 
    26682657        } 
    26692658