--- deliantra/server/common/living.C 2006/09/03 00:18:40 1.5 +++ deliantra/server/common/living.C 2006/09/09 21:48:28 1.7 @@ -1,6 +1,6 @@ /* * static char *rcsid_living_c = - * "$Id: living.C,v 1.5 2006/09/03 00:18:40 root Exp $"; + * "$Id: living.C,v 1.7 2006/09/09 21:48:28 root Exp $"; */ /* @@ -370,7 +370,6 @@ */ int change_abil(object *op, object *tmp) { int flag=QUERY_FLAG(tmp,FLAG_APPLIED)?1:-1,i,j,success=0; - object refop; char message[MAX_BUF]; int potion_max=0; @@ -378,7 +377,8 @@ * refop is a local copy of op only to be used for detecting changes * found by fix_player. refop is not a real object */ - memcpy(&refop, op, sizeof(object)); + object_pod refop; + memcpy (&refop, static_cast(op), sizeof (object_pod)); if(op->type==PLAYER) { if (tmp->type==POTION) { @@ -1586,7 +1586,7 @@ /* Cap permanent experience. */ if (op->perm_exp < 0) op->perm_exp = 0; - else if (op->perm_exp > MAX_EXPERIENCE) + else if (op->perm_exp > (sint64) MAX_EXPERIENCE) op->perm_exp = MAX_EXPERIENCE; } @@ -1709,7 +1709,7 @@ sint64 check_exp_adjust(const object *op, sint64 exp) { if (exp<0) return check_exp_loss(op, exp); - else return MIN(exp, MAX_EXPERIENCE - op->stats.exp); + else return MIN(exp, (sint64) MAX_EXPERIENCE - op->stats.exp); } @@ -1799,7 +1799,7 @@ * MAX_EXPERIENCE to prevent overflows. If the player somehow has * more than max exp, just return. */ - if (exp > 0 && ( op->stats.exp > (MAX_EXPERIENCE - exp))) { + if (exp > 0 && ( op->stats.exp > (sint64) (MAX_EXPERIENCE - exp))) { exp = MAX_EXPERIENCE - op->stats.exp; if (exp < 0) return; }