version 1.50 | | version 1.51 |
---|
| | |
/* | | /* |
* static char *rcsid_plugins_c = | | * static char *rcsid_plugins_c = |
* "$Id: plugins.c,v 1.50 2005/11/01 11:05:33 akirschbaum Exp $"; | | * "$Id: plugins.c,v 1.51 2005/11/01 15:36:19 akirschbaum Exp $"; |
*/ | | */ |
| | |
/*****************************************************************************/ | | /*****************************************************************************/ |
| | |
iarg = va_arg(args, int); | | iarg = va_arg(args, int); |
if (iarg < 0) | | if (iarg < 0) |
iarg = 0; | | iarg = 0; |
if (op->nrof > iarg) | | if (op->nrof > (uint32)iarg) |
decrease_ob_nr(op,op->nrof-iarg); | | decrease_ob_nr(op,op->nrof-iarg); |
else | | else if (op->nrof < (uint32)iarg) |
{ | | { |
object* tmp; | | object* tmp; |
player *pl; | | player *pl; |
| | |
if (pl) tmp=pl->ob; | | if (pl) tmp=pl->ob; |
else tmp=NULL; | | else tmp=NULL; |
} | | } |
| | else { |
| | sum_weight(tmp); |
| | fix_player(tmp); |
| | } |
if (tmp) | | if (tmp) |
esrv_send_item(tmp, op); | | esrv_send_item(tmp, op); |
} | | } |
| | |
break; | | break; |
case CFAPI_OBJECT_PROP_WEIGHT : | | case CFAPI_OBJECT_PROP_WEIGHT : |
iarg = va_arg(args, int); | | iarg = va_arg(args, int); |
| | if (op->weight != iarg) { |
| | object* tmp; |
| | player *pl; |
op->weight = iarg; | | op->weight = iarg; |
| | if (op->env != NULL) |
| | { |
| | tmp = is_player_inv(op->env); |
| | if (!tmp) |
| | { |
| | for (pl=first_player; pl; pl=pl->next) |
| | if (pl->ob->container == op->env) break; |
| | if (pl) tmp=pl->ob; |
| | else tmp=NULL; |
| | } |
| | else { |
| | sum_weight(tmp); |
| | fix_player(tmp); |
| | } |
| | if (tmp) |
| | esrv_send_item(tmp, op); |
| | } |
| | else |
| | { |
| | object *above = op->above; |
| | |
| | for (tmp = above; tmp != NULL; tmp = tmp->above) |
| | if (tmp->type == PLAYER) |
| | esrv_send_item(tmp, op); |
| | } |
| | } |
break; | | break; |
case CFAPI_OBJECT_PROP_WEIGHT_LIMIT : | | case CFAPI_OBJECT_PROP_WEIGHT_LIMIT : |
iarg = va_arg(args, int); | | iarg = va_arg(args, int); |