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.200 by root, Sat Apr 28 17:51:58 2007 UTC vs.
Revision 1.208 by root, Sat May 12 13:27:38 2007 UTC

404inline void sv_to (SV *sv, refptr<T> &v) { T *tmp; sv_to (sv, tmp); v = tmp; } 404inline void sv_to (SV *sv, refptr<T> &v) { T *tmp; sv_to (sv, tmp); v = tmp; }
405 405
406template<int N> 406template<int N>
407inline void sv_to (SV *sv, char (&v)[N]) { assign (v, SvPV_nolen (sv)); } 407inline void sv_to (SV *sv, char (&v)[N]) { assign (v, SvPV_nolen (sv)); }
408 408
409inline void sv_to (SV *sv, rangetype &v) { v = (rangetype) SvIV (sv); }
410inline void sv_to (SV *sv, bowtype_t &v) { v = (bowtype_t) SvIV (sv); } 409inline void sv_to (SV *sv, bowtype_t &v) { v = (bowtype_t) SvIV (sv); }
411inline void sv_to (SV *sv, petmode_t &v) { v = (petmode_t) SvIV (sv); } 410inline void sv_to (SV *sv, petmode_t &v) { v = (petmode_t) SvIV (sv); }
412inline void sv_to (SV *sv, usekeytype &v) { v = (usekeytype) SvIV (sv); } 411inline void sv_to (SV *sv, usekeytype &v) { v = (usekeytype) SvIV (sv); }
413inline void sv_to (SV *sv, unapplymode &v) { v = (unapplymode) SvIV (sv); } 412inline void sv_to (SV *sv, unapplymode &v) { v = (unapplymode) SvIV (sv); }
414 413
1135 const_iv (Map0Cmd) const_iv (Map1Cmd) const_iv (Map1aCmd) 1134 const_iv (Map0Cmd) const_iv (Map1Cmd) const_iv (Map1aCmd)
1136 1135
1137 const_iv (MAP_CLIENT_X) const_iv (MAP_CLIENT_Y) 1136 const_iv (MAP_CLIENT_X) const_iv (MAP_CLIENT_Y)
1138 1137
1139 const_iv (MAX_TIME) 1138 const_iv (MAX_TIME)
1139
1140 const_iv (NUM_BODY_LOCATIONS)
1141 const_iv (body_range) const_iv (body_shield) const_iv (body_combat)
1142 const_iv (body_arm) const_iv (body_torso) const_iv (body_head)
1143 const_iv (body_neck) const_iv (body_skill) const_iv (body_finger)
1144 const_iv (body_shoulder) const_iv (body_foot) const_iv (body_hand)
1145 const_iv (body_wrist) const_iv (body_waist)
1140 1146
1141 const_iv (PLAYER) const_iv (TRANSPORT) const_iv (ROD) const_iv (TREASURE) 1147 const_iv (PLAYER) const_iv (TRANSPORT) const_iv (ROD) const_iv (TREASURE)
1142 const_iv (POTION) const_iv (FOOD) const_iv (POISON) const_iv (BOOK) 1148 const_iv (POTION) const_iv (FOOD) const_iv (POISON) const_iv (BOOK)
1143 const_iv (CLOCK) const_iv (ARROW) const_iv (BOW) const_iv (WEAPON) 1149 const_iv (CLOCK) const_iv (ARROW) const_iv (BOW) const_iv (WEAPON)
1144 const_iv (ARMOUR) const_iv (PEDESTAL) const_iv (ALTAR) const_iv (LOCKED_DOOR) 1150 const_iv (ARMOUR) const_iv (PEDESTAL) const_iv (ALTAR) const_iv (LOCKED_DOOR)
1404 default: croak ("cf::rndm requires none, one or two parameters."); break; 1410 default: croak ("cf::rndm requires none, one or two parameters."); break;
1405 } 1411 }
1406 OUTPUT: 1412 OUTPUT:
1407 RETVAL 1413 RETVAL
1408 1414
1415NV clamp (NV value, NV min_value, NV max_value)
1416 CODE:
1417 RETVAL = clamp (value, min_value, max_value);
1418 OUTPUT:
1419 RETVAL
1420
1421NV lerp (NV value, NV min_in, NV max_in, NV min_out, NV max_out)
1422 CODE:
1423 RETVAL = lerp (value, min_in, max_in, min_out, max_out);
1424 OUTPUT:
1425 RETVAL
1426
1427void cede_to_tick ()
1428 CODE:
1429 coroapi::cede_to_tick ();
1430
1409void server_tick () 1431void server_tick ()
1410 CODE: 1432 CODE:
1411 runtime = SvNVx (sv_runtime); 1433 runtime = SvNVx (sv_runtime);
1412 server_tick (); 1434 server_tick ();
1413 1435
1607object *actives (U32 index) 1629object *actives (U32 index)
1608 CODE: 1630 CODE:
1609 RETVAL = index < actives.size () ? actives [index] : 0; 1631 RETVAL = index < actives.size () ? actives [index] : 0;
1610 OUTPUT: RETVAL 1632 OUTPUT: RETVAL
1611 1633
1634const char *slot_save_name (U32 slot)
1635 ALIAS:
1636 slot_use_name = 1
1637 slot_nonuse_name = 2
1638 CODE:
1639{
1640 if (slot >= NUM_BODY_LOCATIONS)
1641 croak ("body slot index out of range");
1642
1643 switch (ix)
1644 {
1645 case 0: RETVAL = body_locations[slot].save_name; break;
1646 case 1: RETVAL = body_locations[slot].use_name; break;
1647 case 2: RETVAL = body_locations[slot].nonuse_name; break;
1648 }
1649}
1650 OUTPUT:
1651 RETVAL
1652
1612# missing properties 1653# missing properties
1613 1654
1614object *head (object *op) 1655object *head (object *op)
1615 PROTOTYPE: $ 1656 PROTOTYPE: $
1616 CODE: 1657 CODE:
1641int 1682int
1642num_animations (object *op) 1683num_animations (object *op)
1643 CODE: 1684 CODE:
1644 RETVAL = NUM_ANIMATIONS (op); 1685 RETVAL = NUM_ANIMATIONS (op);
1645 OUTPUT: RETVAL 1686 OUTPUT: RETVAL
1687
1688int slot_info (object *op, UV slot, int value = 0)
1689 ALIAS:
1690 slot_used = 1
1691 CODE:
1692{
1693 if (slot >= NUM_BODY_LOCATIONS)
1694 croak ("body slot index out of range");
1695
1696 RETVAL = ix ? op->slot[slot].used : op->slot[slot].info;
1697
1698 if (items > 2)
1699 if (ix)
1700 op->slot[slot].used = value;
1701 else
1702 op->slot[slot].info = value;
1703}
1704 OUTPUT:
1705 RETVAL
1646 1706
1647object *find_best_object_match (object *op, utf8_string match) 1707object *find_best_object_match (object *op, utf8_string match)
1648 1708
1649object *find_marked_object (object *op) 1709object *find_marked_object (object *op)
1650 1710
2002 ob->flag [FLAG_NO_MAP_SAVE] = true; 2062 ob->flag [FLAG_NO_MAP_SAVE] = true;
2003 THIS->insert (ob, x, y, 0, INS_ABOVE_FLOOR_ONLY); 2063 THIS->insert (ob, x, y, 0, INS_ABOVE_FLOOR_ONLY);
2004 2064
2005 if (ob->randomitems) 2065 if (ob->randomitems)
2006 { 2066 {
2067 if (!ob->above)
2068 {
2007 ob->create_treasure (ob->randomitems); 2069 ob->create_treasure (ob->randomitems);
2070
2071 for (object *op = ob->above; op; op = op->above)
2072 op->flag [FLAG_NO_MAP_SAVE] = true;
2073 }
2074
2008 ob->randomitems = 0; 2075 ob->randomitems = 0;
2009 } 2076 }
2010 } 2077 }
2011 } 2078 }
2012 } 2079 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines