… | |
… | |
1290 | * of areas of callers (eg, anything that uses find_free_spot would now |
1290 | * of areas of callers (eg, anything that uses find_free_spot would now |
1291 | * need extra work |
1291 | * need extra work |
1292 | */ |
1292 | */ |
1293 | if (!xy_normalise (m, op->x, op->y)) |
1293 | if (!xy_normalise (m, op->x, op->y)) |
1294 | { |
1294 | { |
1295 | op->destroy (1); |
1295 | op->head_ ()->destroy (1);// remove head_ once all tail object destroyers found |
1296 | return 0; |
1296 | return 0; |
1297 | } |
1297 | } |
1298 | |
1298 | |
1299 | if (object *more = op->more) |
1299 | if (object *more = op->more) |
1300 | if (!insert_ob_in_map (more, m, originator, flag)) |
1300 | if (!insert_ob_in_map (more, m, originator, flag)) |
… | |
… | |
1818 | LOG (llevError, "Present_arch called outside map.\n"); |
1818 | LOG (llevError, "Present_arch called outside map.\n"); |
1819 | return NULL; |
1819 | return NULL; |
1820 | } |
1820 | } |
1821 | |
1821 | |
1822 | for (object *tmp = m->at (x, y).bot; tmp; tmp = tmp->above) |
1822 | for (object *tmp = m->at (x, y).bot; tmp; tmp = tmp->above) |
1823 | if (tmp->arch == at) |
1823 | if (tmp->arch->archname == at->archname) |
1824 | return tmp; |
1824 | return tmp; |
1825 | |
1825 | |
1826 | return NULL; |
1826 | return NULL; |
1827 | } |
1827 | } |
1828 | |
1828 | |
… | |
… | |
1892 | * The first matching object is returned, or NULL if none. |
1892 | * The first matching object is returned, or NULL if none. |
1893 | */ |
1893 | */ |
1894 | object * |
1894 | object * |
1895 | present_arch_in_ob (const archetype *at, const object *op) |
1895 | present_arch_in_ob (const archetype *at, const object *op) |
1896 | { |
1896 | { |
1897 | for (object *tmp = op->inv; tmp != NULL; tmp = tmp->below) |
1897 | for (object *tmp = op->inv; tmp; tmp = tmp->below) |
1898 | if (tmp->arch == at) |
1898 | if (tmp->arch->archname == at->archname) |
1899 | return tmp; |
1899 | return tmp; |
1900 | |
1900 | |
1901 | return NULL; |
1901 | return NULL; |
1902 | } |
1902 | } |
1903 | |
1903 | |