--- deliantra/server/plugins/cfperl/cfperl.xs 2006/02/08 03:46:15 1.15 +++ deliantra/server/plugins/cfperl/cfperl.xs 2006/02/08 04:32:19 1.16 @@ -82,6 +82,7 @@ void clean_obj_cache () { + return; // killing neko-san gives me an unreferenced scalar int todo = 10; do { @@ -91,10 +92,10 @@ if (he) { - SV *sv = SvRV (hv_iterval (obj_cache, he)); + SV *sv = hv_iterval (obj_cache, he); // emopty and unreferened? nuke it - if (SvREFCNT (sv) == 1 && !HvFILL ((HV *)sv)) + if (SvREFCNT (sv) == 1 && SvREFCNT (SvRV (sv)) == 1 && !HvFILL ((HV *)(SvRV (sv)))) { hv_delete (obj_cache, HeKEY (he), HeKLEN (he), G_DISCARD); todo++; @@ -1176,7 +1177,7 @@ void cf_object_set_flag (object *op, int flag, int value) -void cf_object_move (object *op, object *originator, int dir) +void cf_object_move (object *op, int dir, object *originator) void cf_object_apply (object *op, object *author, int flags = 0) @@ -1269,25 +1270,21 @@ object *cf_insert_ob_in_ob (object *ob, object *where) +object *get_nearest_player (object *ob) + ALIAS: nearest_player = 0 + void rangevector (object *ob, object *other, int flags = 0) PROTOTYPE: $$;$ - ALIAS: - direction = 1 - distance = 2 - CODE: + PPCODE: { rv_vector rv; - // get_rangevector uses these if the objects are not on the same map - // which is not the same as "on_same_map". - rv.distance_x = 32767; - rv.distance_y = 32767; get_rangevector (ob, other, &rv, flags); EXTEND (SP, 5); - if (!ix || ix == 2) PUSHs (newSVuv (rv.distance)); - if (!ix) PUSHs (newSViv (rv.distance_x)); - if (!ix) PUSHs (newSViv (rv.distance_y)); - if (!ix || ix == 1) PUSHs (newSViv (rv.direction)); - if (!ix) PUSHs (newSVcfapi (CFAPI_POBJECT, rv.part)); + PUSHs (newSVuv (rv.distance)); + PUSHs (newSViv (rv.distance_x)); + PUSHs (newSViv (rv.distance_y)); + PUSHs (newSViv (rv.direction)); + PUSHs (newSVcfapi (CFAPI_POBJECT, rv.part)); } bool on_same_map_as (object *ob, object *other)