… | |
… | |
1644 | player *next (player *pl) |
1644 | player *next (player *pl) |
1645 | CODE: |
1645 | CODE: |
1646 | RETVAL = pl->next; |
1646 | RETVAL = pl->next; |
1647 | OUTPUT: RETVAL |
1647 | OUTPUT: RETVAL |
1648 | |
1648 | |
|
|
1649 | bool |
|
|
1650 | cell_visible (player *pl, int dx, int dy) |
|
|
1651 | CODE: |
|
|
1652 | RETVAL = FABS (dx) <= pl->socket.mapx / 2 && FABS (dy) <= pl->socket.mapy / 2 |
|
|
1653 | && !pl->blocked_los [dx + pl->socket.mapx / 2][dy + pl->socket.mapy / 2]; |
|
|
1654 | OUTPUT: |
|
|
1655 | RETVAL |
|
|
1656 | |
1649 | void |
1657 | void |
1650 | send (player *pl, SV *packet) |
1658 | send (player *pl, SV *packet) |
1651 | CODE: |
1659 | CODE: |
1652 | { |
1660 | { |
1653 | STRLEN len; |
1661 | STRLEN len; |
… | |
… | |
1778 | object *cf_map_insert_object (mapstruct *where, object* op, int x, int y) |
1786 | object *cf_map_insert_object (mapstruct *where, object* op, int x, int y) |
1779 | |
1787 | |
1780 | object* cf_map_present_arch_by_name (mapstruct *map, const char* str, int nx, int ny) |
1788 | object* cf_map_present_arch_by_name (mapstruct *map, const char* str, int nx, int ny) |
1781 | C_ARGS: str, map, nx, ny |
1789 | C_ARGS: str, map, nx, ny |
1782 | |
1790 | |
1783 | #int cf_map_get_flags (mapstruct* map, mapstruct** nmap, I16 x, I16 y, I16 *nx, I16 *ny) |
|
|
1784 | |
|
|
1785 | void |
1791 | void |
|
|
1792 | cf_map_normalise (mapstruct *map, int x, int y) |
|
|
1793 | PPCODE: |
|
|
1794 | { |
|
|
1795 | mapstruct *nmap = 0; |
|
|
1796 | I16 nx = 0, ny = 0; |
|
|
1797 | int flags = cf_map_get_flags (map, &nmap, x, y, &nx, &ny); |
|
|
1798 | |
|
|
1799 | EXTEND (SP, 4); |
|
|
1800 | PUSHs (sv_2mortal (newSViv (flags))); |
|
|
1801 | |
|
|
1802 | if (GIMME_V == G_ARRAY) |
|
|
1803 | { |
|
|
1804 | PUSHs (sv_2mortal (newSVcfapi (CFAPI_PMAP, nmap))); |
|
|
1805 | PUSHs (sv_2mortal (newSViv (nx))); |
|
|
1806 | PUSHs (sv_2mortal (newSViv (ny))); |
|
|
1807 | } |
|
|
1808 | } |
|
|
1809 | |
|
|
1810 | void |
1786 | at (mapstruct *obj, unsigned int x, unsigned int y) |
1811 | at (mapstruct *map, unsigned int x, unsigned int y) |
1787 | PROTOTYPE: $$$ |
1812 | PROTOTYPE: $$$ |
1788 | INIT: |
|
|
1789 | if (x >= MAP_WIDTH (obj) || y >= MAP_HEIGHT (obj)) XSRETURN_EMPTY; |
|
|
1790 | PPCODE: |
1813 | PPCODE: |
1791 | { |
1814 | { |
1792 | object *o; |
1815 | object *o; |
1793 | |
1816 | mapstruct *nmap = 0; |
|
|
1817 | I16 nx, ny; |
|
|
1818 | |
|
|
1819 | cf_map_get_flags (map, &nmap, x, y, &nx, &ny); |
|
|
1820 | |
|
|
1821 | if (nmap) |
1794 | for (o = GET_MAP_OB (obj, x, y); o; o = o->above) |
1822 | for (o = GET_MAP_OB (nmap, nx, ny); o; o = o->above) |
1795 | XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o))); |
1823 | XPUSHs (sv_2mortal (newSVcfapi (CFAPI_POBJECT, o))); |
1796 | } |
1824 | } |
1797 | |
1825 | |
1798 | SV * |
1826 | SV * |
1799 | bot_at (mapstruct *obj, unsigned int x, unsigned int y) |
1827 | bot_at (mapstruct *obj, unsigned int x, unsigned int y) |
1800 | PROTOTYPE: $$$ |
1828 | PROTOTYPE: $$$ |