1 | /* |
1 | /* |
2 | * static char *rcsid_apply_c = |
2 | * static char *rcsid_apply_c = |
3 | * "$Id: apply.C,v 1.10 2006/08/26 23:36:33 root Exp $"; |
3 | * "$Id: apply.C,v 1.11 2006/08/27 15:24:22 root Exp $"; |
4 | */ |
4 | */ |
5 | /* |
5 | /* |
6 | CrossFire, A Multiplayer game for X-windows |
6 | CrossFire, A Multiplayer game for X-windows |
7 | |
7 | |
8 | Copyright (C) 2001 Mark Wedel & Crossfire Development Team |
8 | Copyright (C) 2001 Mark Wedel & Crossfire Development Team |
… | |
… | |
1291 | |
1291 | |
1292 | if (op->container && QUERY_FLAG(sack, FLAG_APPLIED)) { |
1292 | if (op->container && QUERY_FLAG(sack, FLAG_APPLIED)) { |
1293 | if (op->container->env != op) { /* if container is on the ground */ |
1293 | if (op->container->env != op) { /* if container is on the ground */ |
1294 | op->container->move_off = 0; |
1294 | op->container->move_off = 0; |
1295 | } |
1295 | } |
1296 | /* Lauwenmark: Handle for plugin close event */ |
1296 | |
1297 | if (execute_event(tmp, EVENT_CLOSE,op,NULL,NULL,SCRIPT_FIX_ALL)!=0) |
1297 | if (INVOKE_OBJECT (CLOSE, op)) |
1298 | return 1; |
1298 | return 1; |
1299 | |
1299 | |
1300 | new_draw_info_format(NDI_UNIQUE, 0, op, "You close %s.", |
1300 | new_draw_info_format(NDI_UNIQUE, 0, op, "You close %s.", |
1301 | query_name(op->container)); |
1301 | query_name(op->container)); |
1302 | CLEAR_FLAG(op->container, FLAG_APPLIED); |
1302 | CLEAR_FLAG(op->container, FLAG_APPLIED); |
1303 | op->container=NULL; |
1303 | op->container=NULL; |
… | |
… | |
1576 | return; |
1576 | return; |
1577 | } |
1577 | } |
1578 | recursion_depth++; |
1578 | recursion_depth++; |
1579 | if (trap->head) trap=trap->head; |
1579 | if (trap->head) trap=trap->head; |
1580 | |
1580 | |
1581 | /* Lauwenmark: Handle for plugin trigger event */ |
1581 | if (INVOKE_OBJECT (MOVE_TRIGGER, trap, ARG_OBJECT (victim), ARG_OBJECT (originator))) |
1582 | if (execute_event(trap, EVENT_TRIGGER,originator,victim,NULL,SCRIPT_FIX_ALL)!=0) |
|
|
1583 | goto leave; |
1582 | goto leave; |
1584 | |
1583 | |
1585 | switch (trap->type) { |
1584 | switch (trap->type) { |
1586 | case PLAYERMOVER: |
1585 | case PLAYERMOVER: |
1587 | if (trap->attacktype && (trap->level || victim->type!=PLAYER) && |
1586 | if (trap->attacktype && (trap->level || victim->type!=PLAYER) && |
… | |
… | |
2547 | return 0; /* monsters just skip unpaid items */ |
2546 | return 0; /* monsters just skip unpaid items */ |
2548 | } |
2547 | } |
2549 | } |
2548 | } |
2550 | |
2549 | |
2551 | |
2550 | |
2552 | /* Lauwenmark: Handle for plugin apply event */ |
|
|
2553 | //TODO: remove |
|
|
2554 | if (execute_event(tmp, EVENT_APPLY,op,NULL,NULL,SCRIPT_FIX_ALL)!=0) |
|
|
2555 | return 1; |
|
|
2556 | |
|
|
2557 | if (INVOKE_OBJECT (APPLY, tmp, ARG_OBJECT (op))) |
2551 | if (INVOKE_OBJECT (APPLY, tmp, ARG_OBJECT (op))) |
2558 | return 1; |
2552 | return RESULT_INT (0); |
2559 | |
2553 | |
2560 | switch (tmp->type) { |
2554 | switch (tmp->type) { |
2561 | |
2555 | |
2562 | case TRANSPORT: |
2556 | case TRANSPORT: |
2563 | return apply_transport(op, tmp, aflag); |
2557 | return apply_transport(op, tmp, aflag); |