Changeset 671

Show
Ignore:
Timestamp:
01/31/08 03:51:36 (7 months ago)
Author:
takkaria
Message:

Stop access to p_ptr->target_* from anywhere except target.c.

Files:

Legend:

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

    r653 r671  
    714714        if ((dir == 5) && target_okay()) 
    715715        { 
    716                 tx = p_ptr->target_col; 
    717                 ty = p_ptr->target_row; 
     716                target_get(&tx, &ty); 
    718717        } 
    719718 
     
    10071006        if ((dir == 5) && target_okay()) 
    10081007        { 
    1009                 tx = p_ptr->target_col; 
    1010                 ty = p_ptr->target_row; 
     1008                target_get(&tx, &ty); 
    10111009        } 
    10121010 
  • trunk/src/externs.h

    r670 r671  
    557557bool target_set_interactive(int mode); 
    558558bool get_aim_dir(int *dp); 
     559void target_get(s16b *col, s16b *row); 
     560s16b target_get_monster(void); 
    559561 
    560562/* trap.c */ 
  • trunk/src/monster2.c

    r633 r671  
    4949 
    5050        /* Hack -- remove target monster */ 
    51         if (p_ptr->target_who == i) target_set_monster(0); 
     51        if (target_get_monster() == i) target_set_monster(0); 
    5252 
    5353        /* Hack -- remove tracked monster */ 
     
    144144 
    145145        /* Hack -- Update the target */ 
    146         if (p_ptr->target_who == i1) p_ptr->target_who = i2
     146        if (target_get_monster() == i1) target_set_monster(i2)
    147147 
    148148        /* Hack -- Update the health bar */ 
  • trunk/src/spells2.c

    r656 r671  
    31493149                flg &= ~(PROJECT_STOP); 
    31503150 
    3151                 ty = p_ptr->target_row; 
    3152                 tx = p_ptr->target_col; 
     3151                target_get(&tx, &ty); 
    31533152        } 
    31543153 
     
    31813180        /* Hack -- Use an actual "target" (early detonation) */ 
    31823181        if ((dir == 5) && target_okay()) 
    3183         { 
    3184                 ty = p_ptr->target_row; 
    3185                 tx = p_ptr->target_col; 
    3186         } 
     3182                target_get(&tx, &ty); 
    31873183 
    31883184        while (num--) 
     
    32153211        /* Hack -- Use an actual "target" */ 
    32163212        if ((dir == 5) && target_okay()) 
    3217         { 
    3218                 ty = p_ptr->target_row; 
    3219                 tx = p_ptr->target_col; 
    3220         } 
     3213                target_get(&tx, &ty); 
    32213214 
    32223215        /* Analyze the "dir" and the "target", do NOT explode */