// TBAMUD STOCK AGE:
struct time_info_data *age(struct char_data *ch)
{
static struct time_info_data player_age;
player_age = *mud_time_passed(time(0), ch->player.time.birth);
player_age.year += 17; /* All players start at 17 */
return (&player_age);
}
// MY AGE CODE:
Code:
struct time_info_data *age(struct char_data *ch)
{
static struct time_info_data player_age;
player_age = *mud_time_passed(time(0), ch->player.time.birth);
switch (GET_RACE(ch))
{
case RACE_HALF_GIANT:
player_age.year += 58;
break;
case RACE_HALFLING:
player_age.year += 75;
break;
case RACE_DWARF:
player_age.year += 100;
break;
case RACE_ELF:
player_age.year += 118;
break;
case RACE_GNOME:
player_age.year += 80;
break;
case RACE_HUMAN:
default:
player_age.year += 18;
break;
}
return (&player_age);
}
.
Firstly with the thamud code setting people ages works fine they start as age 17 and if i with set changed to 25 it will be 25.
As you can see in my code i only added cases for each race like:
case RACE_DWARF:
player_age.year += 58; // this line is like the one in TBAMUD code just 58 instead of 17.
break; // break and on to next case
With my code people start with the age i specified BUT THEN if i with set change from dwarfs start age 58 to lets say 65 it will be set to 66.
BIG question is why ?
Should i remove:
default:
in case RACE_HUMAN ?