version 1.49 | | version 1.50 |
---|
| | |
/* | | /* |
* static char *rcsid_plugins_c = | | * static char *rcsid_plugins_c = |
* "$Id: plugins.c,v 1.49 2005/10/29 09:34:02 ryo_saeba Exp $"; | | * "$Id: plugins.c,v 1.50 2005/11/01 11:05:33 akirschbaum Exp $"; |
*/ | | */ |
| | |
/*****************************************************************************/ | | /*****************************************************************************/ |
| | |
if (third != NULL) | | if (third != NULL) |
LOG(llevDebug, " - Other object :%s\n",third->name); | | LOG(llevDebug, " - Other object :%s\n",third->name); |
LOG(llevDebug, " - Event code :%d\n",tmp->subtype); | | LOG(llevDebug, " - Event code :%d\n",tmp->subtype); |
| | if (tmp->title != NULL) |
LOG(llevDebug, " - Event plugin :%s\n",tmp->title); | | LOG(llevDebug, " - Event plugin :%s\n",tmp->title); |
| | if (tmp->slaying != NULL) |
LOG(llevDebug, " - Event hook :%s\n",tmp->slaying); | | LOG(llevDebug, " - Event hook :%s\n",tmp->slaying); |
| | if (tmp->name != NULL) |
LOG(llevDebug, " - Event options :%s\n",tmp->name); | | LOG(llevDebug, " - Event options :%s\n",tmp->name); |
| | |
| | if (tmp->title == NULL) |
| | { |
| | object *env = object_get_env_recursive(tmp); |
| | LOG(llevError, "Event object without title at %d/%d in map %s\n", env->x, env->y, env->map->name); |
| | remove_ob(tmp); |
| | free_object(tmp); |
| | } |
| | else if (tmp->slaying == NULL) |
| | { |
| | object *env = object_get_env_recursive(tmp); |
| | LOG(llevError, "Event object without slaying at %d/%d in map %s\n", env->x, env->y, env->map->name); |
| | remove_ob(tmp); |
| | free_object(tmp); |
| | } |
| | else |
| | { |
plugin = plugins_find_plugin(tmp->title); | | plugin = plugins_find_plugin(tmp->title); |
if (plugin != NULL) | | if (plugin == NULL) |
{ | | { |
int rvt=0; | | object *env = object_get_env_recursive(tmp); |
rv = *(int*)(plugin->eventfunc( | | LOG(llevError, "The requested plugin doesn't exit: %s at %d/%d in map %s\n", tmp->title, env->x, env->y, env->map->name); |
&rvt,op,eventcode,activator,third,message,fix,tmp->slaying, tmp->name)); | | remove_ob(tmp); |
return rv; | | free_object(tmp); |
} | | } |
else | | else |
{ | | { |
LOG(llevError, "The requested plugin doesn't exist: %s",tmp->title); | | int rvt = 0; |
return 0; | | int *rv; |
| | |
| | rv = plugin->eventfunc(&rvt, op, eventcode, activator, third, message, fix, tmp->slaying, tmp->name); |
| | return *rv; |
| | } |
} | | } |
} | | } |
} | | } |