… | |
… | |
43 | static const hook_entry plug_hooks[NR_OF_HOOKS] = { |
43 | static const hook_entry plug_hooks[NR_OF_HOOKS] = { |
44 | {cfapi_system_register_global_event, 1, "cfapi_system_register_global_event"}, |
44 | {cfapi_system_register_global_event, 1, "cfapi_system_register_global_event"}, |
45 | {cfapi_system_unregister_global_event, 3, "cfapi_system_unregister_global_event"}, |
45 | {cfapi_system_unregister_global_event, 3, "cfapi_system_unregister_global_event"}, |
46 | {cfapi_system_check_path, 4, "cfapi_system_check_path"}, |
46 | {cfapi_system_check_path, 4, "cfapi_system_check_path"}, |
47 | {NULL, 5, "cfapi_system_re_cmp"}, |
47 | {NULL, 5, "cfapi_system_re_cmp"}, |
48 | {cfapi_system_strdup_local, 6, "cfapi_system_strdup_local"}, |
48 | {cfapi_system_strdup, 6, "cfapi_system_strdup"}, |
49 | {cfapi_system_directory, 7, "cfapi_system_directory"}, |
49 | {cfapi_system_directory, 7, "cfapi_system_directory"}, |
50 | {cfapi_system_find_animation, 8, "cfapi_system_find_animation"}, |
50 | {cfapi_system_find_animation, 8, "cfapi_system_find_animation"}, |
51 | {cfapi_object_clean_object, 9, "cfapi_object_clean_object"}, |
51 | {cfapi_object_clean_object, 9, "cfapi_object_clean_object"}, |
52 | {cfapi_object_on_same_map, 10, "cfapi_object_on_same_map"}, |
52 | {cfapi_object_on_same_map, 10, "cfapi_object_on_same_map"}, |
53 | {cfapi_object_get_key, 11, "cfapi_object_get_key"}, |
53 | {cfapi_object_get_key, 11, "cfapi_object_get_key"}, |
… | |
… | |
482 | *type = CFAPI_INT; |
482 | *type = CFAPI_INT; |
483 | return &rv; |
483 | return &rv; |
484 | } |
484 | } |
485 | |
485 | |
486 | void * |
486 | void * |
487 | cfapi_system_strdup_local (int *type, ...) |
487 | cfapi_system_strdup (int *type, ...) |
488 | { |
488 | { |
489 | va_list args; |
489 | va_list args; |
490 | char *txt; |
490 | char *txt; |
491 | |
491 | |
492 | va_start (args, type); |
492 | va_start (args, type); |
493 | txt = va_arg (args, char *); |
493 | txt = va_arg (args, char *); |
494 | |
494 | |
495 | va_end (args); |
495 | va_end (args); |
496 | *type = CFAPI_STRING; |
496 | *type = CFAPI_STRING; |
497 | return strdup_local (txt); |
497 | return strdup (txt); |
498 | } |
498 | } |
499 | |
499 | |
500 | void * |
500 | void * |
501 | cfapi_system_register_global_event (int *type, ...) |
501 | cfapi_system_register_global_event (int *type, ...) |
502 | { |
502 | { |
… | |
… | |
1846 | rv = &ri; |
1846 | rv = &ri; |
1847 | *type = CFAPI_INT; |
1847 | *type = CFAPI_INT; |
1848 | break; |
1848 | break; |
1849 | |
1849 | |
1850 | case CFAPI_PLAYER_PROP_IP: |
1850 | case CFAPI_PLAYER_PROP_IP: |
1851 | rv = op->contr->socket.host; |
1851 | rv = op->contr->socket->host; |
1852 | *type = CFAPI_STRING; |
1852 | *type = CFAPI_STRING; |
1853 | break; |
1853 | break; |
1854 | |
1854 | |
1855 | case CFAPI_PLAYER_PROP_MARKED_ITEM: |
1855 | case CFAPI_PLAYER_PROP_MARKED_ITEM: |
1856 | rv = find_marked_object (op); |
1856 | rv = find_marked_object (op); |
… | |
… | |
3310 | drop (author, op); |
3310 | drop (author, op); |
3311 | |
3311 | |
3312 | if (author->type == PLAYER) |
3312 | if (author->type == PLAYER) |
3313 | { |
3313 | { |
3314 | author->contr->count = 0; |
3314 | author->contr->count = 0; |
3315 | author->contr->socket.update_look = 1; |
3315 | author->contr->socket->update_look = 1; |
3316 | } |
3316 | } |
3317 | |
3317 | |
3318 | *type = CFAPI_NONE; |
3318 | *type = CFAPI_NONE; |
3319 | return NULL; |
3319 | return NULL; |
3320 | } |
3320 | } |