ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/plugins.C
(Generate patch)

Comparing deliantra/server/server/plugins.C (file contents):
Revision 1.19 by pippijn, Mon Dec 11 19:46:47 2006 UTC vs.
Revision 1.21 by root, Tue Dec 12 21:39:57 2006 UTC

2604 op = va_arg (args, object *); 2604 op = va_arg (args, object *);
2605 2605
2606 va_end (args); 2606 va_end (args);
2607 2607
2608 send_removed_object (op); 2608 send_removed_object (op);
2609 remove_ob (op); 2609 op->remove ();
2610 *type = CFAPI_NONE; 2610 *type = CFAPI_NONE;
2611 return NULL; 2611 return NULL;
2612} 2612}
2613 2613
2614void * 2614void *
2621 2621
2622 op = va_arg (args, object *); 2622 op = va_arg (args, object *);
2623 2623
2624 va_end (args); 2624 va_end (args);
2625 2625
2626 free_object (op); 2626 op->destroy ();
2627 2627
2628 *type = CFAPI_NONE; 2628 *type = CFAPI_NONE;
2629 return NULL; 2629 return NULL;
2630} 2630}
2631 2631
2650 } 2650 }
2651 else 2651 else
2652 { 2652 {
2653 object *tmp; 2653 object *tmp;
2654 2654
2655 tmp = get_object (); 2655 tmp = object::create ();
2656 copy_object (op, tmp); 2656 op->copy_to (tmp);
2657 *type = CFAPI_POBJECT; 2657 *type = CFAPI_POBJECT;
2658 return tmp; 2658 return tmp;
2659 } 2659 }
2660} 2660}
2661void * 2661void *
2725 *type = CFAPI_POBJECT; 2725 *type = CFAPI_POBJECT;
2726 switch (ival) 2726 switch (ival)
2727 { 2727 {
2728 case 0: 2728 case 0:
2729 va_end (args); 2729 va_end (args);
2730 return get_object (); 2730 return object::create ();
2731 break; 2731 break;
2732 2732
2733 case 1: /* Named object. Nearly the old plugin behavior, but we don't add artifact suffixes */ 2733 case 1: /* Named object. Nearly the old plugin behavior, but we don't add artifact suffixes */
2734 { 2734 {
2735 char *sval; 2735 char *sval;
2738 2738
2739 op = get_archetype_by_object_name (sval); 2739 op = get_archetype_by_object_name (sval);
2740 2740
2741 if (strncmp (query_name (op), ARCH_SINGULARITY, ARCH_SINGULARITY_LEN) == 0) 2741 if (strncmp (query_name (op), ARCH_SINGULARITY, ARCH_SINGULARITY_LEN) == 0)
2742 { 2742 {
2743 free_object (op); 2743 op->destroy ();
2744 /* Try with archetype names... */ 2744 /* Try with archetype names... */
2745 op = get_archetype (sval); 2745 op = get_archetype (sval);
2746 if (strncmp (query_name (op), ARCH_SINGULARITY, ARCH_SINGULARITY_LEN) == 0) 2746 if (strncmp (query_name (op), ARCH_SINGULARITY, ARCH_SINGULARITY_LEN) == 0)
2747 { 2747 {
2748 free_object (op); 2748 op->destroy ();
2749 *type = CFAPI_NONE; 2749 *type = CFAPI_NONE;
2750 va_end (args); 2750 va_end (args);
2751 return NULL; 2751 return NULL;
2752 } 2752 }
2753 } 2753 }
3222 x = map->enter_x; 3222 x = map->enter_x;
3223 y = map->enter_y; 3223 y = map->enter_y;
3224 } 3224 }
3225 3225
3226/* 3226/*
3227 originator = get_object(); 3227 originator = object::create();
3228 EXIT_PATH(originator) = add_string(map->path); 3228 EXIT_PATH(originator) = add_string(map->path);
3229 EXIT_X(originator) = x; 3229 EXIT_X(originator) = x;
3230 EXIT_Y(originator) = y; 3230 EXIT_Y(originator) = y;
3231 printf("B Transfer: X=%d, Y=%d, OP=%s\n", x, y, op->name);*/ 3231 printf("B Transfer: X=%d, Y=%d, OP=%s\n", x, y, op->name);*/
3232 /*enter_exit(op, originator); */ 3232 /*enter_exit(op, originator); */
3233 insert_ob_in_map_at (op, map, NULL, 0, x, y); 3233 insert_ob_in_map_at (op, map, NULL, 0, x, y);
3234 /*printf("A Transfer: X=%d, Y=%d, MAP=%s\n", x, y, op->map->name); 3234 /*printf("A Transfer: X=%d, Y=%d, MAP=%s\n", x, y, op->map->name);
3235 free_object(originator); 3235 originator->destroy ();
3236 */ 3236 */
3237 *type = CFAPI_INT; 3237 *type = CFAPI_INT;
3238 return &rv; 3238 return &rv;
3239 break; 3239 break;
3240 3240
3429 result = 1; 3429 result = 1;
3430 return &result; 3430 return &result;
3431 } 3431 }
3432 3432
3433 send_removed_object (who); 3433 send_removed_object (who);
3434 remove_ob (who); 3434 who->remove ();
3435 3435
3436 for (tmp = who; tmp != NULL; tmp = tmp->more) 3436 for (tmp = who; tmp != NULL; tmp = tmp->more)
3437 tmp->x = x + freearr_x[k] + (tmp->arch == NULL ? 0 : tmp->arch->clone.x), 3437 tmp->x = x + freearr_x[k] + (tmp->arch == NULL ? 0 : tmp->arch->clone.x),
3438 tmp->y = y + freearr_y[k] + (tmp->arch == NULL ? 0 : tmp->arch->clone.y); 3438 tmp->y = y + freearr_y[k] + (tmp->arch == NULL ? 0 : tmp->arch->clone.y);
3439 3439

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines