… | |
… | |
230 | do_destroy (); |
230 | do_destroy (); |
231 | sever_self (); |
231 | sever_self (); |
232 | } |
232 | } |
233 | |
233 | |
234 | void |
234 | void |
|
|
235 | attachable::do_delete () |
|
|
236 | { |
|
|
237 | delete this; |
|
|
238 | } |
|
|
239 | |
|
|
240 | void |
235 | attachable::check_mortals () |
241 | attachable::check_mortals () |
236 | { |
242 | { |
237 | static int i = 0; |
243 | static int i = 0; |
238 | |
244 | |
239 | for (;;) |
245 | for (;;) |
… | |
… | |
252 | |
258 | |
253 | if (0) |
259 | if (0) |
254 | { |
260 | { |
255 | for (int j = 0; j < mortals.size (); ++j)//D |
261 | for (int j = 0; j < mortals.size (); ++j)//D |
256 | fprintf (stderr, "%d:%s %p ", j, &((object *)mortals[j])->name, mortals[j]);//D |
262 | fprintf (stderr, "%d:%s %p ", j, &((object *)mortals[j])->name, mortals[j]);//D |
|
|
263 | |
257 | fprintf (stderr, "\n");//D |
264 | fprintf (stderr, "\n");//D |
258 | } |
265 | } |
259 | } |
266 | } |
260 | } |
267 | } |
261 | |
268 | |
… | |
… | |
281 | } |
288 | } |
282 | else |
289 | else |
283 | { |
290 | { |
284 | mortals.erase (i); |
291 | mortals.erase (i); |
285 | obj->sever_self (); |
292 | obj->sever_self (); |
286 | delete obj; |
293 | obj->do_delete (); |
287 | } |
294 | } |
288 | } |
295 | } |
289 | } |
296 | } |
290 | |
297 | |
291 | void |
298 | void |
… | |
… | |
1224 | object::ref () const |
1231 | object::ref () const |
1225 | { |
1232 | { |
1226 | if (type == PLAYER) |
1233 | if (type == PLAYER) |
1227 | return format ("player/<1.%llx>/%s", (unsigned long long)uuid.seq, &name); |
1234 | return format ("player/<1.%llx>/%s", (unsigned long long)uuid.seq, &name); |
1228 | else |
1235 | else |
|
|
1236 | // TODO: should be able to save references within the same map, at least |
1229 | return 0; |
1237 | return 0; |
1230 | } |
1238 | } |
1231 | |
1239 | |
1232 | object * |
1240 | object * |
1233 | object::deref (const_utf8_string ref) |
1241 | object::deref (const_utf8_string ref) |
… | |
… | |
1460 | const_iv (MAP_INACTIVE) |
1468 | const_iv (MAP_INACTIVE) |
1461 | |
1469 | |
1462 | const_iv (KLASS_ATTACHABLE) const_iv (KLASS_GLOBAL) const_iv (KLASS_OBJECT) |
1470 | const_iv (KLASS_ATTACHABLE) const_iv (KLASS_GLOBAL) const_iv (KLASS_OBJECT) |
1463 | const_iv (KLASS_CLIENT) const_iv (KLASS_PLAYER) const_iv (KLASS_MAP) |
1471 | const_iv (KLASS_CLIENT) const_iv (KLASS_PLAYER) const_iv (KLASS_MAP) |
1464 | |
1472 | |
1465 | const_iv (VERSION_CS) const_iv (VERSION_SC) |
|
|
1466 | |
|
|
1467 | const_iv (CS_QUERY_YESNO) const_iv (CS_QUERY_SINGLECHAR) const_iv (CS_QUERY_HIDEINPUT) |
1473 | const_iv (CS_QUERY_YESNO) const_iv (CS_QUERY_SINGLECHAR) const_iv (CS_QUERY_HIDEINPUT) |
1468 | |
1474 | |
1469 | const_iv (IO_HEADER) const_iv (IO_OBJECTS) const_iv (IO_UNIQUES) |
1475 | const_iv (IO_HEADER) const_iv (IO_OBJECTS) const_iv (IO_UNIQUES) |
1470 | }; |
1476 | }; |
1471 | |
1477 | |
… | |
… | |
1590 | CODE: |
1596 | CODE: |
1591 | UUID::init (); |
1597 | UUID::init (); |
1592 | |
1598 | |
1593 | void init_signals () |
1599 | void init_signals () |
1594 | |
1600 | |
1595 | void init_commands () |
|
|
1596 | |
|
|
1597 | void init_skills () |
1601 | void init_skills () |
1598 | |
1602 | |
1599 | void init_beforeplay () |
1603 | void init_beforeplay () |
1600 | |
1604 | |
1601 | void evthread_start (int aiofd) |
1605 | void evthread_start (int aiofd) |
… | |
… | |
1678 | CODE: |
1682 | CODE: |
1679 | RETVAL = lerp (value, min_in, max_in, min_out, max_out); |
1683 | RETVAL = lerp (value, min_in, max_in, min_out, max_out); |
1680 | OUTPUT: |
1684 | OUTPUT: |
1681 | RETVAL |
1685 | RETVAL |
1682 | |
1686 | |
|
|
1687 | const char *ordinal (int i) |
|
|
1688 | |
1683 | void weaken (...) |
1689 | void weaken (...) |
1684 | PROTOTYPE: @ |
1690 | PROTOTYPE: @ |
1685 | CODE: |
1691 | CODE: |
1686 | while (items > 0) |
1692 | while (items > 0) |
1687 | sv_rvweaken (ST (--items)); |
1693 | sv_rvweaken (ST (--items)); |
1688 | |
1694 | |
1689 | void |
1695 | void log_suspend () |
|
|
1696 | |
|
|
1697 | void log_resume () |
|
|
1698 | |
1690 | log_backtrace (utf8_string msg) |
1699 | void log_backtrace (utf8_string msg) |
1691 | |
1700 | |
1692 | void |
|
|
1693 | LOG (int flags, utf8_string msg) |
1701 | void LOG (int flags, utf8_string msg) |
1694 | PROTOTYPE: $$ |
1702 | PROTOTYPE: $$ |
1695 | C_ARGS: flags, "%s", msg |
1703 | C_ARGS: flags, "%s", msg |
1696 | |
1704 | |
1697 | octet_string path_combine (octet_string base, octet_string path) |
1705 | octet_string path_combine (octet_string base, octet_string path) |
1698 | PROTOTYPE: $$ |
1706 | PROTOTYPE: $$ |
… | |
… | |
2158 | PROTOTYPE: $$;$ |
2166 | PROTOTYPE: $$;$ |
2159 | PPCODE: |
2167 | PPCODE: |
2160 | { |
2168 | { |
2161 | rv_vector rv; |
2169 | rv_vector rv; |
2162 | |
2170 | |
2163 | PUTBACK; |
|
|
2164 | get_rangevector (ob, other, &rv, flags); |
2171 | get_rangevector (ob, other, &rv, flags); |
2165 | SPAGAIN; |
|
|
2166 | |
2172 | |
2167 | EXTEND (SP, 5); |
2173 | EXTEND (SP, 5); |
2168 | PUSHs (newSVuv (rv.distance)); |
2174 | PUSHs (sv_2mortal (newSVuv (rv.distance))); |
2169 | PUSHs (newSViv (rv.distance_x)); |
2175 | PUSHs (sv_2mortal (newSViv (rv.distance_x))); |
2170 | PUSHs (newSViv (rv.distance_y)); |
2176 | PUSHs (sv_2mortal (newSViv (rv.distance_y))); |
2171 | PUSHs (newSViv (rv.direction)); |
2177 | PUSHs (sv_2mortal (newSViv (rv.direction))); |
2172 | PUSHs (to_sv (rv.part)); |
2178 | PUSHs (sv_2mortal (to_sv (rv.part))); |
2173 | } |
2179 | } |
2174 | |
2180 | |
2175 | bool on_same_map_as (object *ob, object *other) |
2181 | bool on_same_map_as (object *ob, object *other) |
2176 | CODE: |
2182 | CODE: |
2177 | RETVAL = on_same_map (ob, other); |
2183 | RETVAL = on_same_map (ob, other); |