… | |
… | |
2100 | void rangevector (object *ob, object *other, int flags = 0) |
2100 | void rangevector (object *ob, object *other, int flags = 0) |
2101 | PROTOTYPE: $$;$ |
2101 | PROTOTYPE: $$;$ |
2102 | PPCODE: |
2102 | PPCODE: |
2103 | { |
2103 | { |
2104 | rv_vector rv; |
2104 | rv_vector rv; |
|
|
2105 | |
|
|
2106 | PUTBACK; |
2105 | get_rangevector (ob, other, &rv, flags); |
2107 | get_rangevector (ob, other, &rv, flags); |
|
|
2108 | SPAGAIN; |
|
|
2109 | |
2106 | EXTEND (SP, 5); |
2110 | EXTEND (SP, 5); |
2107 | PUSHs (newSVuv (rv.distance)); |
2111 | PUSHs (newSVuv (rv.distance)); |
2108 | PUSHs (newSViv (rv.distance_x)); |
2112 | PUSHs (newSViv (rv.distance_x)); |
2109 | PUSHs (newSViv (rv.distance_y)); |
2113 | PUSHs (newSViv (rv.distance_y)); |
2110 | PUSHs (newSViv (rv.direction)); |
2114 | PUSHs (newSViv (rv.direction)); |
… | |
… | |
2417 | get_map_flags (maptile *map, int x, int y) |
2421 | get_map_flags (maptile *map, int x, int y) |
2418 | PPCODE: |
2422 | PPCODE: |
2419 | { |
2423 | { |
2420 | maptile *nmap = 0; |
2424 | maptile *nmap = 0; |
2421 | I16 nx = 0, ny = 0; |
2425 | I16 nx = 0, ny = 0; |
|
|
2426 | |
|
|
2427 | PUTBACK; |
2422 | int flags = get_map_flags (map, &nmap, x, y, &nx, &ny); |
2428 | int flags = get_map_flags (map, &nmap, x, y, &nx, &ny); |
|
|
2429 | SPAGAIN; |
2423 | |
2430 | |
2424 | EXTEND (SP, 4); |
2431 | EXTEND (SP, 4); |
2425 | PUSHs (sv_2mortal (newSViv (flags))); |
2432 | PUSHs (sv_2mortal (newSViv (flags))); |
2426 | |
2433 | |
2427 | if (GIMME_V == G_ARRAY) |
2434 | if (GIMME_V == G_ARRAY) |
… | |
… | |
2435 | void |
2442 | void |
2436 | at (maptile *map, unsigned int x, unsigned int y) |
2443 | at (maptile *map, unsigned int x, unsigned int y) |
2437 | PROTOTYPE: $$$ |
2444 | PROTOTYPE: $$$ |
2438 | PPCODE: |
2445 | PPCODE: |
2439 | { |
2446 | { |
2440 | object *o; |
|
|
2441 | maptile *nmap = 0; |
2447 | maptile *nmap = 0; |
2442 | I16 nx, ny; |
2448 | I16 nx, ny; |
2443 | |
2449 | |
|
|
2450 | PUTBACK; |
2444 | get_map_flags (map, &nmap, x, y, &nx, &ny); |
2451 | get_map_flags (map, &nmap, x, y, &nx, &ny); |
|
|
2452 | SPAGAIN; |
2445 | |
2453 | |
2446 | if (nmap) |
2454 | if (nmap) |
2447 | for (o = GET_MAP_OB (nmap, nx, ny); o; o = o->above) |
2455 | for (object *o = nmap->at (nx, ny).bot; o; o = o->above) |
2448 | XPUSHs (sv_2mortal (to_sv (o))); |
2456 | XPUSHs (sv_2mortal (to_sv (o))); |
2449 | } |
2457 | } |
2450 | |
2458 | |
2451 | SV * |
2459 | SV * |
2452 | bot_at (maptile *obj, unsigned int x, unsigned int y) |
2460 | bot_at (maptile *obj, unsigned int x, unsigned int y) |