version 1.44 | | version 1.45 |
---|
| | |
/* | | /* |
* static char *rcsid_living_c = | | * static char *rcsid_living_c = |
* "$Id: living.c,v 1.44 2002/12/03 07:40:10 mwedel Exp $"; | | * "$Id: living.c,v 1.45 2002/12/06 05:36:28 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* Note that if permanent exp is used, player may not in fact lose | | * Note that if permanent exp is used, player may not in fact lose |
* as much as listed. Eg, if player has gotten reduced to the point | | * as much as listed. Eg, if player has gotten reduced to the point |
* where everything is at the minimum perm exp, he would lose nothing. | | * where everything is at the minimum perm exp, he would lose nothing. |
| | * exp is the amount of exp to subtract - thus, it should be |
| | * a postive number. |
*/ | | */ |
static void subtract_player_exp(object *op, int exp) | | static void subtract_player_exp(object *op, int exp) |
{ | | { |
| | |
object *tmp; | | object *tmp; |
int total_loss = 0, del_exp; | | int total_loss = 0, del_exp; |
| | |
| | |
for(tmp=op->inv;tmp;tmp=tmp->below) | | for(tmp=op->inv;tmp;tmp=tmp->below) |
if(tmp->type==EXPERIENCE && tmp->stats.exp) { | | if(tmp->type==EXPERIENCE && tmp->stats.exp) { |
del_exp = check_exp_loss(tmp, tmp->stats.exp * fraction); | | del_exp = check_exp_loss(tmp, tmp->stats.exp * fraction); |
| | |
if(exp>0) | | if(exp>0) |
add_player_exp(op, exp); | | add_player_exp(op, exp); |
else | | else |
subtract_player_exp(op, exp); | | subtract_player_exp(op, FABS(exp)); |
| | |
} | | } |
/* Reset players experience object pointer - From old code - | | /* Reset players experience object pointer - From old code - |