Changeset 945

Show
Ignore:
Timestamp:
05/21/08 11:33:56 (6 months ago)
Author:
takkaria
Message:

(#420) Fix ammo damage display.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/obj-info.c

    r918 r945  
    294294 * list[] and mult[] must be > 11 in size 
    295295 */ 
    296 static int collect_slays(cptr desc[], int mult[], u32b f1) 
     296static int collect_slays(const char *desc[], int mult[], u32b f1) 
    297297{ 
    298298        int cnt = 0; 
     
    329329static bool describe_combat(const object_type *o_ptr, bool full) 
    330330{ 
    331         cptr desc[15]; 
    332         int mult[15]; 
     331        const char *desc[16]; 
     332        int mult[16]; 
    333333        int cnt, dam; 
    334334        int xtra_dam = 0; 
     
    363363                int blows = calc_blows(o_ptr); 
    364364                int extra_blows = 0; 
    365                  
     365 
    366366                if (f1 & (TR1_BLOWS)) extra_blows += o_ptr->pval; 
    367367                blows += extra_blows; 
     
    379379                        blows = 1; 
    380380                } 
    381          
     381 
    382382            text_out("With this weapon, you would currently get "); 
    383383            text_out_c(TERM_L_GREEN, format("%d ", blows)); 
     
    390390        { 
    391391                int tdis = 6 + 2 * p_ptr->ammo_mult; 
     392                u32b f[3]; 
    392393 
    393394                /* Calculate damage */ 
    394395                dam = ((o_ptr->ds + 1) * o_ptr->dd * 5); 
    395                 if (object_known_p(o_ptr)) xtra_dam += (o_ptr->to_d * 10); 
    396                 if (object_known_p(j_ptr)) xtra_dam += (j_ptr->to_d * 10); 
    397                 xtra_dam *= p_ptr->ammo_mult; 
    398                 xtra_dam += (dam * 2); 
     396                dam *= p_ptr->ammo_mult; 
     397                if (object_known_p(o_ptr)) dam += (o_ptr->to_d * 10); 
     398                if (object_known_p(j_ptr)) dam += (j_ptr->to_d * 10); 
     399 
     400                /* Apply brands from the shooter to the ammo */ 
     401                object_flags(j_ptr, &f[0], &f[1], &f[2]); 
     402                f1 |= f[0]; 
    399403 
    400404                text_out("Fired from your current missile launcher, this arrow will hit targets up to ");