Ticket #907: birth_money.patch

File birth_money.patch, 1.5 KB (added by rhinocesaurus, 10 years ago)

Patch. Note, player_type.au_birth and birther.au now hold what the birth AU would be when birth_money option is not set; otherwise there is not enough info saved upon death to calculate correct birth AU in all cases.

  • src/birth.c

     
    138138        p_ptr->wt = p_ptr->wt_birth = player->wt; 
    139139        p_ptr->ht = p_ptr->ht_birth = player->ht; 
    140140        p_ptr->sc = p_ptr->sc_birth = player->sc; 
    141         p_ptr->au = p_ptr->au_birth = player->au; 
     141        p_ptr->au_birth = player->au; 
     142        if (OPT(birth_money)) 
     143                p_ptr->au = 500; 
     144        else 
     145                p_ptr->au = p_ptr->au_birth; 
    142146 
    143147        /* Load the stats */ 
    144148        for (i = 0; i < A_MAX; i++) 
     
    406410 */ 
    407411static void get_money(int stat_use[A_MAX]) 
    408412{ 
    409         if (OPT(birth_money)) 
    410                 p_ptr->au = p_ptr->au_birth = 500; 
    411         else 
     413        if (OPT(birth_money)) { 
     414                p_ptr->au_birth = 200; 
     415                p_ptr->au = 500; 
     416        } else { 
    412417                p_ptr->au = p_ptr->au_birth = 200; 
     418        } 
    413419} 
    414420 
    415421 
     
    672678        else 
    673679                p_ptr->au = 200 + (50 * points_left); 
    674680 
    675         p_ptr->au_birth = p_ptr->au; 
     681        p_ptr->au_birth = 200 + (50 * points_left); 
    676682 
    677683        /* Update bonuses, hp, etc. */ 
    678684        get_bonuses(); 
  • src/player/types.h

     
    233233 
    234234 
    235235        /* Generation fields (for quick start) */ 
    236         s32b au_birth;          /* Birth gold */ 
     236        s32b au_birth;          /* Birth gold when option birth_money is false */ 
    237237        s16b stat_birth[A_MAX]; /* Birth "natural" stat values */ 
    238238        s16b ht_birth;          /* Birth Height */ 
    239239        s16b wt_birth;          /* Birth Weight */