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

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.326 by root, Mon Oct 12 21:27:55 2009 UTC vs.
Revision 1.335 by root, Wed Nov 11 04:45:23 2009 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2001-2005,2007 by Chachkoff Yann
6 * Copyright (©) 2006,2007 by Marc Lehmann <cf@schmorp.de> 5 * Copyright (©) 2006,2007 by Marc Lehmann <cf@schmorp.de>
7 * 6 *
8 * Deliantra is free software: you can redistribute it and/or modify it under 7 * Deliantra is free software: you can redistribute it and/or modify it under
9 * the terms of the Affero GNU General Public License as published by the 8 * the terms of the Affero GNU General Public License as published by the
10 * Free Software Foundation, either version 3 of the License, or (at your 9 * Free Software Foundation, either version 3 of the License, or (at your
295 294
296 attach = src.attach; 295 attach = src.attach;
297 return *this; 296 return *this;
298} 297}
299 298
299#if 0
300template<typename T> 300template<typename T>
301static bool 301static bool
302find_backref (void *ptr, T *obj) 302find_backref (void *ptr, T *obj)
303{ 303{
304 char *s = (char *)obj; 304 char *s = (char *)obj;
312 312
313 return false; 313 return false;
314} 314}
315 315
316// for debugging, find "live" objects containing this ptr 316// for debugging, find "live" objects containing this ptr
317void 317static void
318find_backref (void *ptr) 318find_backref (void *ptr)
319{ 319{
320 for_all_objects (op) 320 for_all_objects (op)
321 if (find_backref (ptr, op)) 321 if (find_backref (ptr, op))
322 fprintf (stderr, "O %p %d:'%s'\n", op, op->count, &op->name); 322 fprintf (stderr, "O %p %d:'%s'\n", op, op->count, &op->name);
327 327
328 for_all_clients (ns) 328 for_all_clients (ns)
329 if (find_backref (ptr, ns)) 329 if (find_backref (ptr, ns))
330 fprintf (stderr, "C %p\n", ns); 330 fprintf (stderr, "C %p\n", ns);
331} 331}
332#endif
332 333
333////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 334//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
334 335
335static SV * 336static SV *
336newSVptr (void *ptr, HV *stash, HV *hv = newHV ()) 337newSVptr (void *ptr, HV *stash, HV *hv = newHV ())
389 390
390 return sv; 391 return sv;
391 } 392 }
392} 393}
393 394
395#if 0 // unused
394static void 396static void
395clearSVptr (SV *sv) 397clearSVptr (SV *sv)
396{ 398{
397 if (SvROK (sv)) 399 if (SvROK (sv))
398 sv = SvRV (sv); 400 sv = SvRV (sv);
399 401
400 hv_clear ((HV *)sv); 402 hv_clear ((HV *)sv);
401 sv_unmagic (sv, PERL_MAGIC_ext); 403 sv_unmagic (sv, PERL_MAGIC_ext);
402} 404}
405#endif
403 406
404static long 407static long
405SvPTR (SV *sv, const char *klass) 408SvPTR (SV *sv, const char *klass)
406{ 409{
407 if (!sv_derived_from (sv, klass)) 410 if (!sv_derived_from (sv, klass))
422 return SvPTR (sv, klass); 425 return SvPTR (sv, klass);
423 else 426 else
424 return 0; 427 return 0;
425} 428}
426 429
427inline SV *to_sv (const shstr & v) { return newSVpvn_utf8 ((const char *)v, v.length (), 1); } 430static inline SV *to_sv (const shstr & v) { return newSVpvn_utf8 ((const char *)v, v.length (), 1); }
428inline SV *to_sv (const char * v) { return v ? newSVpv (v, 0) : newSV (0); } 431static inline SV *to_sv (const char * v) { return v ? newSVpv (v, 0) : newSV (0); }
429inline SV *to_sv (bool v) { return newSViv (v); } 432static inline SV *to_sv (bool v) { return newSViv (v); }
430inline SV *to_sv ( signed char v) { return newSViv (v); } 433static inline SV *to_sv ( signed char v) { return newSViv (v); }
431inline SV *to_sv (unsigned char v) { return newSViv (v); } 434static inline SV *to_sv (unsigned char v) { return newSViv (v); }
432inline SV *to_sv ( signed short v) { return newSViv (v); } 435static inline SV *to_sv ( signed short v) { return newSViv (v); }
433inline SV *to_sv (unsigned short v) { return newSVuv (v); } 436static inline SV *to_sv (unsigned short v) { return newSVuv (v); }
434inline SV *to_sv ( signed int v) { return newSViv (v); } 437static inline SV *to_sv ( signed int v) { return newSViv (v); }
435inline SV *to_sv (unsigned int v) { return newSVuv (v); } 438static inline SV *to_sv (unsigned int v) { return newSVuv (v); }
436inline SV *to_sv ( signed long v) { return newSViv (v); } 439static inline SV *to_sv ( signed long v) { return newSViv (v); }
437inline SV *to_sv (unsigned long v) { return newSVuv (v); } 440static inline SV *to_sv (unsigned long v) { return newSVuv (v); }
438inline SV *to_sv ( signed long long v) { return newSVval64 (v); } 441static inline SV *to_sv ( signed long long v) { return newSVval64 (v); }
439inline SV *to_sv (unsigned long long v) { return newSVval64 (v); } 442static inline SV *to_sv (unsigned long long v) { return newSVval64 (v); }
440inline SV *to_sv (float v) { return newSVnv (v); } 443static inline SV *to_sv (float v) { return newSVnv (v); }
441inline SV *to_sv (double v) { return newSVnv (v); } 444static inline SV *to_sv (double v) { return newSVnv (v); }
442inline SV *to_sv (client * v) { return newSVattachable (v, stash_cf_client_wrap); } 445static inline SV *to_sv (client * v) { return newSVattachable (v, stash_cf_client_wrap); }
443inline SV *to_sv (player * v) { return newSVattachable (v, stash_cf_player_wrap); } 446static inline SV *to_sv (player * v) { return newSVattachable (v, stash_cf_player_wrap); }
444inline SV *to_sv (object * v) { return newSVattachable (v, v && v->type == PLAYER ? stash_cf_object_player_wrap : stash_cf_object_wrap); } 447static inline SV *to_sv (object * v) { return newSVattachable (v, v && v->type == PLAYER ? stash_cf_object_player_wrap : stash_cf_object_wrap); }
445inline SV *to_sv (maptile * v) { return newSVattachable (v, stash_cf_map_wrap); } 448static inline SV *to_sv (maptile * v) { return newSVattachable (v, stash_cf_map_wrap); }
446inline SV *to_sv (archetype * v) { return newSVattachable (v, stash_cf_arch_wrap); } 449static inline SV *to_sv (archetype * v) { return newSVattachable (v, stash_cf_arch_wrap); }
447inline SV *to_sv (region * v) { return newSVattachable (v, stash_cf_region_wrap); } 450static inline SV *to_sv (region * v) { return newSVattachable (v, stash_cf_region_wrap); }
448inline SV *to_sv (partylist * v) { return newSVptr (v, stash_cf_party_wrap); } 451static inline SV *to_sv (partylist * v) { return newSVptr (v, stash_cf_party_wrap); }
449inline SV *to_sv (living * v) { return newSVptr (v, stash_cf_living_wrap); } 452static inline SV *to_sv (living * v) { return newSVptr (v, stash_cf_living_wrap); }
450inline SV *to_sv (mapspace * v) { return newSVptr (v, stash_cf_mapspace_wrap); } 453static inline SV *to_sv (mapspace * v) { return newSVptr (v, stash_cf_mapspace_wrap); }
451 454
452inline SV *to_sv (object & v) { return to_sv (&v); } 455static inline SV *to_sv (object & v) { return to_sv (&v); }
453inline SV *to_sv (living & v) { return to_sv (&v); } 456static inline SV *to_sv (living & v) { return to_sv (&v); }
454 457
455inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); } 458static inline SV *to_sv (const std::string & v) { return newSVpvn (v.data (), v.size ()); }
456inline SV *to_sv (const treasurelist *v) { return to_sv (v->name); } 459static inline SV *to_sv (const treasurelist *v) { return to_sv (v->name); }
457 460
458inline SV *to_sv (UUID v) { return newSVpv (v.c_str (), 0); } 461static inline SV *to_sv (UUID v) { return newSVpv (v.c_str (), 0); }
459 462
460inline SV *to_sv (dynbuf * v) 463static inline SV *to_sv (dynbuf * v)
461{ 464{
462 SV *sv = newSV (0); 465 SV *sv = newSV (0);
463 466
464 sv_upgrade (sv, SVt_PV); 467 sv_upgrade (sv, SVt_PV);
465 SvGROW (sv, v->size () + 1); 468 SvGROW (sv, v->size () + 1);
469 *SvEND (sv) = 0; 472 *SvEND (sv) = 0;
470 473
471 return sv; 474 return sv;
472} 475}
473 476
474inline SV *to_sv (dynbuf_text * v) 477static inline SV *to_sv (dynbuf_text * v)
475{ 478{
476 SV *sv = to_sv (static_cast<dynbuf *> (v)); 479 SV *sv = to_sv (static_cast<dynbuf *> (v));
477 SvUTF8_on (sv); 480 SvUTF8_on (sv);
478 return sv; 481 return sv;
479} 482}
480 483
481inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPVutf8_nolen (sv) : 0; } 484static inline void sv_to (SV *sv, shstr &v) { v = SvOK (sv) ? SvPVutf8_nolen (sv) : 0; }
482inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; } 485static inline void sv_to (SV *sv, char * &v) { free (v); v = SvOK (sv) ? strdup (SvPV_nolen (sv)) : 0; }
483inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); } 486static inline void sv_to (SV *sv, bool &v) { v = SvIV (sv); }
484inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); } 487static inline void sv_to (SV *sv, signed char &v) { v = SvIV (sv); }
485inline void sv_to (SV *sv, unsigned char &v) { v = SvIV (sv); } 488static inline void sv_to (SV *sv, unsigned char &v) { v = SvIV (sv); }
486inline void sv_to (SV *sv, signed short &v) { v = SvIV (sv); } 489static inline void sv_to (SV *sv, signed short &v) { v = SvIV (sv); }
487inline void sv_to (SV *sv, unsigned short &v) { v = SvIV (sv); } 490static inline void sv_to (SV *sv, unsigned short &v) { v = SvIV (sv); }
488inline void sv_to (SV *sv, signed int &v) { v = SvIV (sv); } 491static inline void sv_to (SV *sv, signed int &v) { v = SvIV (sv); }
489inline void sv_to (SV *sv, unsigned int &v) { v = SvUV (sv); } 492static inline void sv_to (SV *sv, unsigned int &v) { v = SvUV (sv); }
490inline void sv_to (SV *sv, signed long &v) { v = SvIV (sv); } 493static inline void sv_to (SV *sv, signed long &v) { v = SvIV (sv); }
491inline void sv_to (SV *sv, unsigned long &v) { v = SvUV (sv); } 494static inline void sv_to (SV *sv, unsigned long &v) { v = SvUV (sv); }
492inline void sv_to (SV *sv, signed long long &v) { v = ( signed long long)SvVAL64 (sv); } 495static inline void sv_to (SV *sv, signed long long &v) { v = ( signed long long)SvVAL64 (sv); }
493inline void sv_to (SV *sv, unsigned long long &v) { v = (unsigned long long)SvVAL64 (sv); } 496static inline void sv_to (SV *sv, unsigned long long &v) { v = (unsigned long long)SvVAL64 (sv); }
494inline void sv_to (SV *sv, float &v) { v = SvNV (sv); } 497static inline void sv_to (SV *sv, float &v) { v = SvNV (sv); }
495inline void sv_to (SV *sv, double &v) { v = SvNV (sv); } 498static inline void sv_to (SV *sv, double &v) { v = SvNV (sv); }
496inline void sv_to (SV *sv, client * &v) { v = (client *)(attachable *)SvPTR_ornull (sv, "cf::client"); } 499static inline void sv_to (SV *sv, client * &v) { v = (client *)(attachable *)SvPTR_ornull (sv, "cf::client"); }
497inline void sv_to (SV *sv, player * &v) { v = (player *)(attachable *)SvPTR_ornull (sv, "cf::player"); } 500static inline void sv_to (SV *sv, player * &v) { v = (player *)(attachable *)SvPTR_ornull (sv, "cf::player"); }
498inline void sv_to (SV *sv, object * &v) { v = (object *)(attachable *)SvPTR_ornull (sv, "cf::object"); } 501static inline void sv_to (SV *sv, object * &v) { v = (object *)(attachable *)SvPTR_ornull (sv, "cf::object"); }
499inline void sv_to (SV *sv, archetype * &v) { v = (archetype *)(attachable *)SvPTR_ornull (sv, "cf::arch"); } 502static inline void sv_to (SV *sv, archetype * &v) { v = (archetype *)(attachable *)SvPTR_ornull (sv, "cf::arch"); }
500inline void sv_to (SV *sv, maptile * &v) { v = (maptile *)(attachable *)SvPTR_ornull (sv, "cf::map"); } 503static inline void sv_to (SV *sv, maptile * &v) { v = (maptile *)(attachable *)SvPTR_ornull (sv, "cf::map"); }
501inline void sv_to (SV *sv, region * &v) { v = (region *)(attachable *)SvPTR_ornull (sv, "cf::region"); } 504static inline void sv_to (SV *sv, region * &v) { v = (region *)(attachable *)SvPTR_ornull (sv, "cf::region"); }
502inline void sv_to (SV *sv, attachable * &v) { v = (attachable *)SvPTR_ornull (sv, "cf::attachable"); } 505static inline void sv_to (SV *sv, attachable * &v) { v = (attachable *)SvPTR_ornull (sv, "cf::attachable"); }
503inline void sv_to (SV *sv, partylist * &v) { v = (partylist *)SvPTR_ornull (sv, "cf::party"); } 506static inline void sv_to (SV *sv, partylist * &v) { v = (partylist *)SvPTR_ornull (sv, "cf::party"); }
504inline void sv_to (SV *sv, living * &v) { v = (living *)SvPTR_ornull (sv, "cf::living"); } 507static inline void sv_to (SV *sv, living * &v) { v = (living *)SvPTR_ornull (sv, "cf::living"); }
505inline void sv_to (SV *sv, mapspace * &v) { v = (mapspace *)SvPTR_ornull (sv, "cf::mapspace"); } 508static inline void sv_to (SV *sv, mapspace * &v) { v = (mapspace *)SvPTR_ornull (sv, "cf::mapspace"); }
506inline void sv_to (SV *sv, object_freezer * &v) { v = (object_freezer *)SvPTR_ornull (sv, "cf::object::freezer"); } 509static inline void sv_to (SV *sv, object_freezer * &v) { v = (object_freezer *)SvPTR_ornull (sv, "cf::object::freezer"); }
507inline void sv_to (SV *sv, object_thawer * &v) { v = (object_thawer *)SvPTR_ornull (sv, "cf::object::thawer" ); } 510static inline void sv_to (SV *sv, object_thawer * &v) { v = (object_thawer *)SvPTR_ornull (sv, "cf::object::thawer" ); }
508 511
509//inline void sv_to (SV *sv, faceinfo * &v) { v = &faces [face_find (SvPV_nolen (sv), 0)]; } 512//static inline void sv_to (SV *sv, faceinfo * &v) { v = &faces [face_find (SvPV_nolen (sv), 0)]; }
510inline void sv_to (SV *sv, treasurelist * &v) { v = treasurelist::find (SvPV_nolen (sv)); } 513static inline void sv_to (SV *sv, treasurelist * &v) { v = treasurelist::find (SvPV_nolen (sv)); }
511 514
512template<class T> 515template<class T>
513inline void sv_to (SV *sv, refptr<T> &v) { T *tmp; sv_to (sv, tmp); v = tmp; } 516static inline void sv_to (SV *sv, refptr<T> &v) { T *tmp; sv_to (sv, tmp); v = tmp; }
514 517
515template<int N> 518template<int N>
516inline void sv_to (SV *sv, char (&v)[N]) { assign (v, SvPV_nolen (sv)); } 519static inline void sv_to (SV *sv, char (&v)[N]) { assign (v, SvPV_nolen (sv)); }
517 520
518inline void sv_to (SV *sv, bowtype_t &v) { v = (bowtype_t) SvIV (sv); } 521static inline void sv_to (SV *sv, bowtype_t &v) { v = (bowtype_t) SvIV (sv); }
519inline void sv_to (SV *sv, petmode_t &v) { v = (petmode_t) SvIV (sv); } 522static inline void sv_to (SV *sv, petmode_t &v) { v = (petmode_t) SvIV (sv); }
520inline void sv_to (SV *sv, usekeytype &v) { v = (usekeytype) SvIV (sv); } 523static inline void sv_to (SV *sv, usekeytype &v) { v = (usekeytype) SvIV (sv); }
521inline void sv_to (SV *sv, unapplymode &v) { v = (unapplymode) SvIV (sv); } 524static inline void sv_to (SV *sv, unapplymode &v) { v = (unapplymode) SvIV (sv); }
522 525
523inline void sv_to (SV *sv, std::string &v) 526static inline void sv_to (SV *sv, std::string &v)
524{ 527{
525 STRLEN len; 528 STRLEN len;
526 char *data = SvPVbyte (sv, len); 529 char *data = SvPVbyte (sv, len);
527 v.assign (data, len); 530 v.assign (data, len);
528} 531}
529 532
530inline void sv_to (SV *sv, UUID &v) 533static inline void sv_to (SV *sv, UUID &v)
531{ 534{
532 if (!v.parse (SvPV_nolen (sv))) 535 if (!v.parse (SvPV_nolen (sv)))
533 croak ("unparsable uuid: %s", SvPV_nolen (sv)); 536 croak ("unparsable uuid: %s", SvPV_nolen (sv));
534} 537}
535 538
536inline void sv_to (SV *sv, object::flags_t::reference v) { v = SvTRUE (sv); } 539static inline void sv_to (SV *sv, object::flags_t::reference v) { v = SvTRUE (sv); }
537 540
538static SV * 541static SV *
539newSVdt_va (va_list &ap, data_type type) 542newSVdt_va (va_list &ap, data_type type)
540{ 543{
541 SV *sv; 544 SV *sv;
641 var = 0; 644 var = 0;
642} 645}
643 646
644////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 647//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
645 648
646SV * 649static SV *
647registry (attachable *ext) 650registry (attachable *ext)
648{ 651{
649 if (!ext->cb) 652 if (!ext->cb)
650 ext->cb = newAV (); 653 ext->cb = newAV ();
651 654
935 CALL_END; 938 CALL_END;
936 939
937 return count; 940 return count;
938} 941}
939 942
940SV * 943static SV *
941cfperl_result (int idx) 944cfperl_result (int idx)
942{ 945{
943 AV *av = get_av ("cf::INVOKE_RESULTS", 0); 946 AV *av = get_av ("cf::INVOKE_RESULTS", 0);
944 if (!av) 947 if (!av)
945 return &PL_sv_undef; 948 return &PL_sv_undef;
1221 bool matched = count && SvTRUE (TOPs); 1224 bool matched = count && SvTRUE (TOPs);
1222 1225
1223 CALL_END; 1226 CALL_END;
1224 1227
1225 return matched; 1228 return matched;
1229}
1230
1231object *
1232match_one (const char *expr, object *ob, object *self, object *source, object *originator)
1233{
1234 if (!strncmp (expr, "match ", sizeof ("match ") - 1))
1235 expr += sizeof ("match ") - 1;
1236
1237 CALL_BEGIN (5);
1238 CALL_ARG (expr);
1239 CALL_ARG (ob);
1240 CALL_ARG (self);
1241 CALL_ARG (source);
1242 CALL_ARG (originator);
1243 CALL_CALL (cv_cf_match_match, G_ARRAY);
1244
1245 object *one = 0;
1246
1247 if (count)
1248 sv_to (TOPs, one);
1249
1250 CALL_END;
1251
1252 return one;
1226} 1253}
1227 1254
1228///////////////////////////////////////////////////////////////////////////// 1255/////////////////////////////////////////////////////////////////////////////
1229 1256
1230struct EVAPI *evapi::GEVAPI; 1257struct EVAPI *evapi::GEVAPI;
1400 const_iv (FLAG_GENERATOR) const_iv (FLAG_IS_THROWN) const_iv (FLAG_AUTO_APPLY) const_iv (FLAG_PLAYER_SOLD) 1427 const_iv (FLAG_GENERATOR) const_iv (FLAG_IS_THROWN) const_iv (FLAG_AUTO_APPLY) const_iv (FLAG_PLAYER_SOLD)
1401 const_iv (FLAG_SEE_INVISIBLE) const_iv (FLAG_CAN_ROLL) const_iv (FLAG_OVERLAY_FLOOR) const_iv (FLAG_IS_TURNABLE) 1428 const_iv (FLAG_SEE_INVISIBLE) const_iv (FLAG_CAN_ROLL) const_iv (FLAG_OVERLAY_FLOOR) const_iv (FLAG_IS_TURNABLE)
1402 const_iv (FLAG_IS_USED_UP) const_iv (FLAG_IDENTIFIED) const_iv (FLAG_REFLECTING) const_iv (FLAG_CHANGING) 1429 const_iv (FLAG_IS_USED_UP) const_iv (FLAG_IDENTIFIED) const_iv (FLAG_REFLECTING) const_iv (FLAG_CHANGING)
1403 const_iv (FLAG_SPLITTING) const_iv (FLAG_HITBACK) const_iv (FLAG_STARTEQUIP) const_iv (FLAG_BLOCKSVIEW) 1430 const_iv (FLAG_SPLITTING) const_iv (FLAG_HITBACK) const_iv (FLAG_STARTEQUIP) const_iv (FLAG_BLOCKSVIEW)
1404 const_iv (FLAG_UNDEAD) const_iv (FLAG_SCARED) const_iv (FLAG_UNAGGRESSIVE) const_iv (FLAG_REFL_MISSILE) 1431 const_iv (FLAG_UNDEAD) const_iv (FLAG_SCARED) const_iv (FLAG_UNAGGRESSIVE) const_iv (FLAG_REFL_MISSILE)
1405 const_iv (FLAG_REFL_SPELL) const_iv (FLAG_NO_MAGIC) const_iv (FLAG_NO_FIX_PLAYER) const_iv (FLAG_IS_LIGHTABLE) 1432 const_iv (FLAG_REFL_SPELL) const_iv (FLAG_NO_MAGIC) const_iv (FLAG_IS_LIGHTABLE)
1406 const_iv (FLAG_TEAR_DOWN) const_iv (FLAG_RUN_AWAY) const_iv (FLAG_PICK_UP) const_iv (FLAG_UNIQUE) 1433 const_iv (FLAG_TEAR_DOWN) const_iv (FLAG_RUN_AWAY) const_iv (FLAG_PICK_UP) const_iv (FLAG_UNIQUE)
1407 const_iv (FLAG_NO_DROP) const_iv (FLAG_WIZCAST) const_iv (FLAG_CAST_SPELL) const_iv (FLAG_USE_SCROLL) 1434 const_iv (FLAG_NO_DROP) const_iv (FLAG_WIZCAST) const_iv (FLAG_CAST_SPELL) const_iv (FLAG_USE_SCROLL)
1408 const_iv (FLAG_USE_RANGE) const_iv (FLAG_USE_BOW) const_iv (FLAG_USE_ARMOUR) const_iv (FLAG_USE_WEAPON) 1435 const_iv (FLAG_USE_RANGE) const_iv (FLAG_USE_BOW) const_iv (FLAG_USE_ARMOUR) const_iv (FLAG_USE_WEAPON)
1409 const_iv (FLAG_USE_RING) const_iv (FLAG_READY_RANGE) const_iv (FLAG_READY_BOW) const_iv (FLAG_XRAYS) 1436 const_iv (FLAG_USE_RING) const_iv (FLAG_READY_RANGE) const_iv (FLAG_READY_BOW) const_iv (FLAG_XRAYS)
1410 const_iv (FLAG_NO_APPLY) const_iv (FLAG_IS_FLOOR) const_iv (FLAG_LIFESAVE) const_iv (FLAG_NO_STRENGTH) 1437 const_iv (FLAG_NO_APPLY) const_iv (FLAG_IS_FLOOR) const_iv (FLAG_LIFESAVE) const_iv (FLAG_NO_STRENGTH)
2141 CODE: 2168 CODE:
2142 player_apply_below (op); 2169 player_apply_below (op);
2143 2170
2144int cast_heal (object *op, object *caster, object *spell, int dir = 0) 2171int cast_heal (object *op, object *caster, object *spell, int dir = 0)
2145 2172
2173int casting_level (object *caster, object *spell)
2174
2146int pay_item (object *op, object *buyer) 2175int pay_item (object *op, object *buyer)
2147 CODE: 2176 CODE:
2148 RETVAL = pay_for_item (op, buyer); 2177 RETVAL = pay_for_item (op, buyer);
2149 OUTPUT: RETVAL 2178 OUTPUT: RETVAL
2150 2179
2192 2221
2193void player_lvl_adj (object *who, object *skill = 0) 2222void player_lvl_adj (object *who, object *skill = 0)
2194 2223
2195int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL) 2224int kill_object (object *op, int dam = 0, object *hitter = 0, int type = AT_PHYSICAL)
2196 2225
2197int calc_skill_exp (object *who, object *op, object *skill); 2226int calc_skill_exp (object *who, object *op, object *skill)
2198 2227
2199void push_button (object *op, object *originator); 2228void push_button (object *op, object *originator)
2200 2229
2201void use_trigger (object *op, object *originator); 2230void use_trigger (object *op, object *originator)
2202 2231
2203void handle_apply_yield (object *op); 2232void handle_apply_yield (object *op)
2204 2233
2205int convert_item (object *item, object *converter); 2234int convert_item (object *item, object *converter)
2206 2235
2207 2236
2208MODULE = cf PACKAGE = cf::object PREFIX = cf_ 2237MODULE = cf PACKAGE = cf::object PREFIX = cf_
2209 2238
2210# no clean way to get an object from an archetype - stupid idiotic 2239# no clean way to get an object from an archetype - stupid idiotic
2223object *insert_ob_in_map_at (object *ob, maptile *where, object_ornull *orig, int flag, int x, int y) 2252object *insert_ob_in_map_at (object *ob, maptile *where, object_ornull *orig, int flag, int x, int y)
2224 PROTOTYPE: $$$$$$ 2253 PROTOTYPE: $$$$$$
2225 CODE: 2254 CODE:
2226{ 2255{
2227 RETVAL = insert_ob_in_map_at (ob, where, orig, flag, x, y); 2256 RETVAL = insert_ob_in_map_at (ob, where, orig, flag, x, y);
2257
2258 if (RETVAL->destroyed ())
2259 RETVAL = 0;
2228} 2260}
2229 2261
2230shstr 2262shstr
2231object::kv_get (shstr key) 2263object::kv_get (shstr key)
2232 2264
2643 case 6: RETVAL = newSVuv (ms.move_on ); break; 2675 case 6: RETVAL = newSVuv (ms.move_on ); break;
2644 case 7: RETVAL = newSVuv (ms.move_off ); break; 2676 case 7: RETVAL = newSVuv (ms.move_off ); break;
2645 } 2677 }
2646} 2678}
2647 OUTPUT: RETVAL 2679 OUTPUT: RETVAL
2648
2649void fix_walls (maptile *map, int x, int y)
2650
2651void fix_walls_around (maptile *map, int x, int y)
2652 2680
2653# worst xs function of my life 2681# worst xs function of my life
2654bool 2682bool
2655_create_random_map (\ 2683_create_random_map (\
2656 maptile *self,\ 2684 maptile *self,\

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines