… | |
… | |
1035 | |
1035 | |
1036 | map = va_arg (args, maptile *); |
1036 | map = va_arg (args, maptile *); |
1037 | x = va_arg (args, int); |
1037 | x = va_arg (args, int); |
1038 | y = va_arg (args, int); |
1038 | y = va_arg (args, int); |
1039 | |
1039 | |
1040 | update_position (map, x, y); |
1040 | map->at (x, y).flags_ |= P_NEED_UPDATE; |
|
|
1041 | |
1041 | va_end (args); |
1042 | va_end (args); |
1042 | *type = CFAPI_NONE; |
1043 | *type = CFAPI_NONE; |
1043 | return NULL; |
1044 | return NULL; |
1044 | } |
1045 | } |
1045 | |
1046 | |
… | |
… | |
1849 | rv = &ri; |
1850 | rv = &ri; |
1850 | *type = CFAPI_INT; |
1851 | *type = CFAPI_INT; |
1851 | break; |
1852 | break; |
1852 | |
1853 | |
1853 | case CFAPI_PLAYER_PROP_IP: |
1854 | case CFAPI_PLAYER_PROP_IP: |
1854 | rv = op->contr->socket->host; |
1855 | rv = op->contr->ns->host; |
1855 | *type = CFAPI_STRING; |
1856 | *type = CFAPI_STRING; |
1856 | break; |
1857 | break; |
1857 | |
1858 | |
1858 | case CFAPI_PLAYER_PROP_MARKED_ITEM: |
1859 | case CFAPI_PLAYER_PROP_MARKED_ITEM: |
1859 | rv = find_marked_object (op); |
1860 | rv = find_marked_object (op); |
… | |
… | |
1988 | tmp = NULL; |
1989 | tmp = NULL; |
1989 | } |
1990 | } |
1990 | else |
1991 | else |
1991 | { |
1992 | { |
1992 | sum_weight (tmp); |
1993 | sum_weight (tmp); |
1993 | fix_player (tmp); |
1994 | tmp->update_stats (); |
1994 | } |
1995 | } |
1995 | if (tmp) |
1996 | if (tmp) |
1996 | esrv_send_item (tmp, op); |
1997 | esrv_send_item (tmp, op); |
1997 | } |
1998 | } |
1998 | else |
1999 | else |
… | |
… | |
2149 | tmp = NULL; |
2150 | tmp = NULL; |
2150 | } |
2151 | } |
2151 | else |
2152 | else |
2152 | { |
2153 | { |
2153 | sum_weight (tmp); |
2154 | sum_weight (tmp); |
2154 | fix_player (tmp); |
2155 | tmp->update_stats (); |
2155 | } |
2156 | } |
2156 | if (tmp) |
2157 | if (tmp) |
2157 | esrv_send_item (tmp, op); |
2158 | esrv_send_item (tmp, op); |
2158 | } |
2159 | } |
2159 | else |
2160 | else |
… | |
… | |
2519 | } |
2520 | } |
2520 | |
2521 | |
2521 | void * |
2522 | void * |
2522 | cfapi_object_drain (int *type, ...) |
2523 | cfapi_object_drain (int *type, ...) |
2523 | { |
2524 | { |
2524 | va_list args; |
2525 | abort (); |
|
|
2526 | } |
2525 | |
2527 | |
|
|
2528 | void * |
|
|
2529 | cfapi_object_fix (int *type, ...) |
|
|
2530 | { |
|
|
2531 | va_list args; |
2526 | object *op; |
2532 | object *op; |
2527 | int ds; |
|
|
2528 | |
2533 | |
2529 | va_start (args, type); |
2534 | va_start (args, type); |
2530 | |
2535 | |
2531 | op = va_arg (args, object *); |
2536 | op = va_arg (args, object *); |
2532 | ds = va_arg (args, int); |
|
|
2533 | |
2537 | |
2534 | va_end (args); |
2538 | va_end (args); |
2535 | |
2539 | |
2536 | drain_specific_stat (op, ds); |
2540 | op->update_stats (); |
2537 | |
|
|
2538 | *type = CFAPI_NONE; |
|
|
2539 | return NULL; |
|
|
2540 | } |
|
|
2541 | |
|
|
2542 | void * |
|
|
2543 | cfapi_object_fix (int *type, ...) |
|
|
2544 | { |
|
|
2545 | va_list args; |
|
|
2546 | object *op; |
|
|
2547 | |
|
|
2548 | va_start (args, type); |
|
|
2549 | |
|
|
2550 | op = va_arg (args, object *); |
|
|
2551 | |
|
|
2552 | va_end (args); |
|
|
2553 | |
|
|
2554 | fix_player (op); |
|
|
2555 | |
2541 | |
2556 | *type = CFAPI_NONE; |
2542 | *type = CFAPI_NONE; |
2557 | return NULL; |
2543 | return NULL; |
2558 | } |
2544 | } |
2559 | |
2545 | |
… | |
… | |
3313 | drop (author, op); |
3299 | drop (author, op); |
3314 | |
3300 | |
3315 | if (author->type == PLAYER) |
3301 | if (author->type == PLAYER) |
3316 | { |
3302 | { |
3317 | author->contr->count = 0; |
3303 | author->contr->count = 0; |
3318 | author->contr->socket->floorbox_update (); |
3304 | author->contr->ns->floorbox_update (); |
3319 | } |
3305 | } |
3320 | |
3306 | |
3321 | *type = CFAPI_NONE; |
3307 | *type = CFAPI_NONE; |
3322 | return NULL; |
3308 | return NULL; |
3323 | } |
3309 | } |
… | |
… | |
3556 | |
3542 | |
3557 | case CFAPI_PARTY_PROP_PLAYER: |
3543 | case CFAPI_PARTY_PROP_PLAYER: |
3558 | *type = CFAPI_PPLAYER; |
3544 | *type = CFAPI_PPLAYER; |
3559 | obarg = va_arg (args, object *); |
3545 | obarg = va_arg (args, object *); |
3560 | |
3546 | |
3561 | pl = (obarg ? obarg->contr : first_player); |
3547 | pl = (obarg ? (player *)obarg->contr : first_player); |
3562 | rv = NULL; |
3548 | rv = NULL; |
3563 | for (; pl != NULL; pl = pl->next) |
3549 | for (; pl != NULL; pl = pl->next) |
3564 | if (pl->ob->contr->party == party) |
3550 | if (pl->ob->contr->party == party) |
3565 | { |
3551 | { |
3566 | rv = (void *) pl; |
3552 | rv = (void *) pl; |