… | |
… | |
243 | |
243 | |
244 | // now bless the object _once_ |
244 | // now bless the object _once_ |
245 | return sv_bless (newRV_inc ((SV *)obj->self), stash); |
245 | return sv_bless (newRV_inc ((SV *)obj->self), stash); |
246 | } |
246 | } |
247 | else |
247 | else |
|
|
248 | { |
248 | return newRV_inc ((SV *)obj->self); |
249 | SV *sv = newRV_inc ((SV *)obj->self); |
|
|
250 | |
|
|
251 | if (Gv_AMG (stash)) // handle overload correctly, as the perl core does not |
|
|
252 | SvAMAGIC_on (sv); |
|
|
253 | |
|
|
254 | return sv; |
|
|
255 | } |
249 | } |
256 | } |
250 | |
257 | |
251 | static void |
258 | static void |
252 | clearSVptr (SV *sv) |
259 | clearSVptr (SV *sv) |
253 | { |
260 | { |
… | |
… | |
1545 | |
1552 | |
1546 | NV floor (NV x) |
1553 | NV floor (NV x) |
1547 | |
1554 | |
1548 | NV ceil (NV x) |
1555 | NV ceil (NV x) |
1549 | |
1556 | |
|
|
1557 | NV rndm (...) |
|
|
1558 | CODE: |
|
|
1559 | switch (items) |
|
|
1560 | { |
|
|
1561 | case 0: RETVAL = rndm (); break; |
|
|
1562 | case 1: RETVAL = rndm (SvUV (ST (0))); break; |
|
|
1563 | case 2: RETVAL = rndm (SvIV (ST (0)), SvIV (ST (1))); break; |
|
|
1564 | default: croak ("cf::rndm requires none, one or two parameters."); break; |
|
|
1565 | } |
|
|
1566 | OUTPUT: |
|
|
1567 | RETVAL |
|
|
1568 | |
1550 | void server_tick () |
1569 | void server_tick () |
1551 | CODE: |
1570 | CODE: |
1552 | runtime = SvNVx (sv_runtime); |
1571 | runtime = SvNVx (sv_runtime); |
1553 | server_tick (); |
1572 | server_tick (); |
1554 | |
1573 | |
… | |
… | |
1600 | } |
1619 | } |
1601 | OUTPUT: RETVAL |
1620 | OUTPUT: RETVAL |
1602 | |
1621 | |
1603 | void abort () |
1622 | void abort () |
1604 | |
1623 | |
|
|
1624 | void fork_abort (char *cause = "cf::fork_abort") |
|
|
1625 | |
1605 | void cleanup (const char *cause, bool make_core = false) |
1626 | void cleanup (const char *cause, bool make_core = false) |
1606 | |
1627 | |
1607 | void emergency_save () |
1628 | void emergency_save () |
1608 | |
1629 | |
1609 | void _exit (int status = 0) |
1630 | void _exit (int status = 0) |
… | |
… | |
1833 | |
1854 | |
1834 | void drop (object *who, object *op) |
1855 | void drop (object *who, object *op) |
1835 | |
1856 | |
1836 | void pick_up (object *who, object *op) |
1857 | void pick_up (object *who, object *op) |
1837 | |
1858 | |
1838 | object *cf_object_insert_object (object *op, object *container) |
|
|
1839 | |
|
|
1840 | object *cf_object_insert_in_ob (object *ob, object *where) |
|
|
1841 | |
|
|
1842 | int cf_object_teleport (object *op, maptile *map, int x, int y) |
1859 | int cf_object_teleport (object *op, maptile *map, int x, int y) |
1843 | |
1860 | |
1844 | void update_object (object *op, int action) |
1861 | void update_object (object *op, int action) |
1845 | |
1862 | |
1846 | object *cf_create_object_by_name (const char *name) |
1863 | object *cf_create_object_by_name (const char *name) |
… | |
… | |
1964 | |
1981 | |
1965 | void esrv_update_item (object *op, int what, object *item) |
1982 | void esrv_update_item (object *op, int what, object *item) |
1966 | C_ARGS: what, op, item |
1983 | C_ARGS: what, op, item |
1967 | |
1984 | |
1968 | void clear_los (object *op) |
1985 | void clear_los (object *op) |
1969 | |
|
|
1970 | int command_teleport (object *op, char *params) |
|
|
1971 | |
1986 | |
1972 | int command_summon (object *op, char *params) |
1987 | int command_summon (object *op, char *params) |
1973 | |
1988 | |
1974 | int command_arrest (object *op, char *params) |
1989 | int command_arrest (object *op, char *params) |
1975 | |
1990 | |
… | |
… | |
2118 | |
2133 | |
2119 | object* cf_map_present_arch_by_name (maptile *map, const char* str, int nx, int ny) |
2134 | object* cf_map_present_arch_by_name (maptile *map, const char* str, int nx, int ny) |
2120 | C_ARGS: str, map, nx, ny |
2135 | C_ARGS: str, map, nx, ny |
2121 | |
2136 | |
2122 | void |
2137 | void |
2123 | cf_map_normalise (maptile *map, int x, int y) |
2138 | get_map_flags (maptile *map, int x, int y) |
2124 | PPCODE: |
2139 | PPCODE: |
2125 | { |
2140 | { |
2126 | maptile *nmap = 0; |
2141 | maptile *nmap = 0; |
2127 | I16 nx = 0, ny = 0; |
2142 | I16 nx = 0, ny = 0; |
2128 | int flags = get_map_flags (map, &nmap, x, y, &nx, &ny); |
2143 | int flags = get_map_flags (map, &nmap, x, y, &nx, &ny); |
… | |
… | |
2190 | CODE: |
2205 | CODE: |
2191 | RETVAL = get_name_of_region_for_map (m); |
2206 | RETVAL = get_name_of_region_for_map (m); |
2192 | OUTPUT: RETVAL |
2207 | OUTPUT: RETVAL |
2193 | |
2208 | |
2194 | # worst xs function of my life |
2209 | # worst xs function of my life |
2195 | maptile * |
2210 | bool |
2196 | _create_random_map (\ |
2211 | _create_random_map (\ |
2197 | char *path,\ |
2212 | maptile *self,\ |
2198 | char *wallstyle,\ |
2213 | char *wallstyle,\ |
2199 | char *wall_name,\ |
2214 | char *wall_name,\ |
2200 | char *floorstyle,\ |
2215 | char *floorstyle,\ |
2201 | char *monsterstyle,\ |
2216 | char *monsterstyle,\ |
2202 | char *treasurestyle,\ |
2217 | char *treasurestyle,\ |
… | |
… | |
2272 | rmp.treasureoptions = treasureoptions; |
2287 | rmp.treasureoptions = treasureoptions; |
2273 | rmp.symmetry_used = symmetry_used; |
2288 | rmp.symmetry_used = symmetry_used; |
2274 | rmp.region = region; |
2289 | rmp.region = region; |
2275 | rmp.custom = custom; |
2290 | rmp.custom = custom; |
2276 | |
2291 | |
2277 | RETVAL = generate_random_map (path, &rmp); |
2292 | RETVAL = self->generate_random_map (&rmp); |
2278 | } |
2293 | } |
2279 | OUTPUT: |
2294 | OUTPUT: |
2280 | RETVAL |
2295 | RETVAL |
2281 | |
2296 | |
2282 | MODULE = cf PACKAGE = cf::arch |
2297 | MODULE = cf PACKAGE = cf::arch |