… | |
… | |
215 | |
215 | |
216 | /* make sure he's a player -- needed because of class change. */ |
216 | /* make sure he's a player -- needed because of class change. */ |
217 | ob->type = PLAYER; // we are paranoid |
217 | ob->type = PLAYER; // we are paranoid |
218 | ob->race = ob->arch->race; |
218 | ob->race = ob->arch->race; |
219 | |
219 | |
220 | ob->carrying = sum_weight (ob); |
220 | ob->update_weight (); |
221 | link_player_skills (ob); |
221 | link_player_skills (ob); |
222 | |
222 | |
223 | CLEAR_FLAG (ob, FLAG_NO_FIX_PLAYER); |
223 | CLEAR_FLAG (ob, FLAG_NO_FIX_PLAYER); |
224 | |
224 | |
225 | assign (title, ob->arch->object::name); |
225 | assign (title, ob->arch->object::name); |
… | |
… | |
2956 | void |
2956 | void |
2957 | fix_weight (void) |
2957 | fix_weight (void) |
2958 | { |
2958 | { |
2959 | for_all_players (pl) |
2959 | for_all_players (pl) |
2960 | { |
2960 | { |
2961 | int old = pl->ob->carrying, sum = sum_weight (pl->ob); |
2961 | sint32 old = pl->ob->carrying; |
2962 | |
2962 | |
2963 | if (old == sum) |
2963 | pl->ob->update_weight (); |
2964 | continue; |
2964 | |
|
|
2965 | if (old != pl->ob->carrying) |
|
|
2966 | { |
2965 | pl->ob->update_stats (); |
2967 | pl->ob->update_stats (); |
2966 | LOG (llevDebug, "Fixed inventory in %s (%d -> %d)\n", &pl->ob->name, old, sum); |
2968 | LOG (llevDebug, "Fixed inventory in %s (%d -> %d)\n", &pl->ob->name, (int)old, (int)pl->ob->carrying); |
|
|
2969 | } |
2967 | } |
2970 | } |
2968 | } |
2971 | } |
2969 | |
2972 | |
2970 | void |
2973 | void |
2971 | fix_luck (void) |
2974 | fix_luck (void) |