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

Comparing deliantra/server/plugins/cfperl/cfperl.xs (file contents):
Revision 1.15 by root, Wed Feb 8 03:46:15 2006 UTC vs.
Revision 1.16 by root, Wed Feb 8 04:32:19 2006 UTC

80// all objects no longer referenced and empty are 80// all objects no longer referenced and empty are
81// eligible for destruction. 81// eligible for destruction.
82void 82void
83clean_obj_cache () 83clean_obj_cache ()
84{ 84{
85 return; // killing neko-san gives me an unreferenced scalar
85 int todo = 10; 86 int todo = 10;
86 do 87 do
87 { 88 {
88 I32 klen; 89 I32 klen;
89 char *key; 90 char *key;
90 HE *he = hv_iternext (obj_cache); 91 HE *he = hv_iternext (obj_cache);
91 92
92 if (he) 93 if (he)
93 { 94 {
94 SV *sv = SvRV (hv_iterval (obj_cache, he)); 95 SV *sv = hv_iterval (obj_cache, he);
95 96
96 // emopty and unreferened? nuke it 97 // emopty and unreferened? nuke it
97 if (SvREFCNT (sv) == 1 && !HvFILL ((HV *)sv)) 98 if (SvREFCNT (sv) == 1 && SvREFCNT (SvRV (sv)) == 1 && !HvFILL ((HV *)(SvRV (sv))))
98 { 99 {
99 hv_delete (obj_cache, HeKEY (he), HeKLEN (he), G_DISCARD); 100 hv_delete (obj_cache, HeKEY (he), HeKLEN (he), G_DISCARD);
100 todo++; 101 todo++;
101 } 102 }
102 } 103 }
1174int cf_object_get_flag (object *op, int flag) 1175int cf_object_get_flag (object *op, int flag)
1175 ALIAS: flag = 0 1176 ALIAS: flag = 0
1176 1177
1177void cf_object_set_flag (object *op, int flag, int value) 1178void cf_object_set_flag (object *op, int flag, int value)
1178 1179
1179void cf_object_move (object *op, object *originator, int dir) 1180void cf_object_move (object *op, int dir, object *originator)
1180 1181
1181void cf_object_apply (object *op, object *author, int flags = 0) 1182void cf_object_apply (object *op, object *author, int flags = 0)
1182 1183
1183void cf_object_apply_below (object *op) 1184void cf_object_apply_below (object *op)
1184 1185
1267void cf_fix_object (object *pl) 1268void cf_fix_object (object *pl)
1268 ALIAS: fix = 0 1269 ALIAS: fix = 0
1269 1270
1270object *cf_insert_ob_in_ob (object *ob, object *where) 1271object *cf_insert_ob_in_ob (object *ob, object *where)
1271 1272
1273object *get_nearest_player (object *ob)
1274 ALIAS: nearest_player = 0
1275
1272void rangevector (object *ob, object *other, int flags = 0) 1276void rangevector (object *ob, object *other, int flags = 0)
1273 PROTOTYPE: $$;$ 1277 PROTOTYPE: $$;$
1274 ALIAS: 1278 PPCODE:
1275 direction = 1
1276 distance = 2
1277 CODE:
1278{ 1279{
1279 rv_vector rv; 1280 rv_vector rv;
1280 // get_rangevector uses these if the objects are not on the same map
1281 // which is not the same as "on_same_map".
1282 rv.distance_x = 32767;
1283 rv.distance_y = 32767;
1284 get_rangevector (ob, other, &rv, flags); 1281 get_rangevector (ob, other, &rv, flags);
1285 EXTEND (SP, 5); 1282 EXTEND (SP, 5);
1286 if (!ix || ix == 2) PUSHs (newSVuv (rv.distance)); 1283 PUSHs (newSVuv (rv.distance));
1287 if (!ix) PUSHs (newSViv (rv.distance_x)); 1284 PUSHs (newSViv (rv.distance_x));
1288 if (!ix) PUSHs (newSViv (rv.distance_y)); 1285 PUSHs (newSViv (rv.distance_y));
1289 if (!ix || ix == 1) PUSHs (newSViv (rv.direction)); 1286 PUSHs (newSViv (rv.direction));
1290 if (!ix) PUSHs (newSVcfapi (CFAPI_POBJECT, rv.part)); 1287 PUSHs (newSVcfapi (CFAPI_POBJECT, rv.part));
1291} 1288}
1292 1289
1293bool on_same_map_as (object *ob, object *other) 1290bool on_same_map_as (object *ob, object *other)
1294 CODE: 1291 CODE:
1295 RETVAL = on_same_map (ob, other); 1292 RETVAL = on_same_map (ob, other);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines