version 1.52 | | version 1.53 |
---|
| | |
/* | | /* |
* static char *rcsid_plugins_c = | | * static char *rcsid_plugins_c = |
* "$Id: plugins.c,v 1.52 2005/11/09 21:46:59 akirschbaum Exp $"; | | * "$Id: plugins.c,v 1.53 2005/11/09 22:27:19 akirschbaum Exp $"; |
*/ | | */ |
| | |
/*****************************************************************************/ | | /*****************************************************************************/ |
| | |
} | | } |
#endif /* WIN32 */ | | #endif /* WIN32 */ |
| | |
| | /** |
| | * Notify clients about a changed object. |
| | * |
| | * @param op the object that has changed |
| | */ |
| | static void send_changed_object(object *op) |
| | { |
| | object* tmp; |
| | player *pl; |
| | |
| | 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; |
| | } |
| | if (tmp) |
| | esrv_send_item(tmp, op); |
| | } |
| | else |
| | { |
| | for (tmp = op->above; tmp != NULL; tmp = tmp->above) |
| | if (tmp->type == PLAYER) |
| | esrv_send_item(tmp, op); |
| | } |
| | } |
| | |
int execute_event(object* op, int eventcode, object* activator, object* third, const char* message, int fix) | | int execute_event(object* op, int eventcode, object* activator, object* third, const char* message, int fix) |
{ | | { |
object *tmp, *next; | | object *tmp, *next; |
| | |
case CFAPI_OBJECT_PROP_NAME : | | case CFAPI_OBJECT_PROP_NAME : |
sarg = va_arg(args, char*); | | sarg = va_arg(args, char*); |
FREE_AND_COPY(op->name, sarg); | | FREE_AND_COPY(op->name, sarg); |
| | send_changed_object(op); |
break; | | break; |
case CFAPI_OBJECT_PROP_NAME_PLURAL : | | case CFAPI_OBJECT_PROP_NAME_PLURAL : |
sarg = va_arg(args, char*); | | sarg = va_arg(args, char*); |
FREE_AND_COPY(op->name_pl, sarg); | | FREE_AND_COPY(op->name_pl, sarg); |
| | send_changed_object(op); |
break; | | break; |
case CFAPI_OBJECT_PROP_TITLE : | | case CFAPI_OBJECT_PROP_TITLE : |
sarg = va_arg(args, char*); | | sarg = va_arg(args, char*); |
| | |
case CFAPI_OBJECT_PROP_CUSTOM_NAME : | | case CFAPI_OBJECT_PROP_CUSTOM_NAME : |
sarg = va_arg(args, char*); | | sarg = va_arg(args, char*); |
FREE_AND_COPY(op->custom_name, sarg); | | FREE_AND_COPY(op->custom_name, sarg); |
| | send_changed_object(op); |
break; | | break; |
case CFAPI_OBJECT_PROP_ANIM_SPEED : | | case CFAPI_OBJECT_PROP_ANIM_SPEED : |
iarg = va_arg(args, int); | | iarg = va_arg(args, int); |