version 1.74 | | version 1.75 |
---|
| | |
/* | | /* |
* static char *rcsid_plugins_c = | | * static char *rcsid_plugins_c = |
* "$Id: plugins.c,v 1.74 2006/08/08 18:17:54 qal21 Exp $"; | | * "$Id: plugins.c,v 1.75 2006/08/12 19:38:23 qal21 Exp $"; |
*/ | | */ |
| | |
/*****************************************************************************/ | | /*****************************************************************************/ |
| | |
int execute_global_event(int eventcode, ...) | | int execute_global_event(int eventcode, ...) |
{ | | { |
va_list args; | | va_list args; |
| | mapstruct* map; |
object* op; | | object* op; |
object* op2; | | object* op2; |
player* pl; | | player* pl; |
| | |
break; | | break; |
| | |
case EVENT_MAPENTER: | | case EVENT_MAPENTER: |
/*MAPENTER: op*/ | | /*MAPENTER: op, map*/ |
op = va_arg(args, object*); | | op = va_arg(args, object*); |
| | map = va_arg(args, mapstruct*); |
for (cp = plugins_list; cp != NULL; cp = cp->next) { | | for (cp = plugins_list; cp != NULL; cp = cp->next) { |
if (cp->gevent[eventcode] != NULL) | | if (cp->gevent[eventcode] != NULL) |
cp->gevent[eventcode](&rt, eventcode, op); | | cp->gevent[eventcode](&rt, eventcode, op, map); |
} | | } |
break; | | break; |
| | |
case EVENT_MAPLEAVE: | | case EVENT_MAPLEAVE: |
/*MAPLEAVE: op*/ | | /*MAPLEAVE: op, map*/ |
op = va_arg(args, object*); | | op = va_arg(args, object*); |
| | map = va_arg(args, mapstruct*); |
for (cp = plugins_list; cp != NULL; cp = cp->next) { | | for (cp = plugins_list; cp != NULL; cp = cp->next) { |
if (cp->gevent[eventcode] != NULL) | | if (cp->gevent[eventcode] != NULL) |
cp->gevent[eventcode](&rt, eventcode, op); | | cp->gevent[eventcode](&rt, eventcode, op, map); |
} | | } |
break; | | break; |
| | |
case EVENT_MAPRESET: | | case EVENT_MAPRESET: |
/*MAPRESET: map->path*/ | | /*MAPRESET: map*/ |
buf = va_arg(args, char*); | | map = va_arg(args, mapstruct*); |
for (cp = plugins_list; cp != NULL; cp = cp->next) { | | for (cp = plugins_list; cp != NULL; cp = cp->next) { |
if (cp->gevent[eventcode] != NULL) | | if (cp->gevent[eventcode] != NULL) |
cp->gevent[eventcode](&rt, eventcode, buf); | | cp->gevent[eventcode](&rt, eventcode, map); |
} | | } |
break; | | break; |
| | |
| | |
cp->gevent[eventcode](&rt, eventcode, op, buf); | | cp->gevent[eventcode](&rt, eventcode, op, buf); |
} | | } |
break; | | break; |
| | case EVENT_MAPUNLOAD: |
| | /*MAPUNLOAD: map*/ |
| | map = va_arg(args, mapstruct*); |
| | for (cp = plugins_list; cp != NULL; cp = cp->next) { |
| | if (cp->gevent[eventcode] != NULL) |
| | cp->gevent[eventcode](&rt, eventcode, map); |
| | } |
| | break; |
| | case EVENT_MAPLOAD: |
| | /*MAPLOAD: map*/ |
| | map = va_arg(args, mapstruct*); |
| | for (cp = plugins_list; cp != NULL; cp = cp->next) { |
| | if (cp->gevent[eventcode] != NULL) |
| | cp->gevent[eventcode](&rt, eventcode, map); |
| | } |
| | break; |
} | | } |
va_end(args); | | va_end(args); |
return 0; | | return 0; |