… | |
… | |
775 | * drop on that space. |
775 | * drop on that space. |
776 | */ |
776 | */ |
777 | if (!drop_to_ground |
777 | if (!drop_to_ground |
778 | || !map |
778 | || !map |
779 | || map->in_memory != MAP_IN_MEMORY |
779 | || map->in_memory != MAP_IN_MEMORY |
|
|
780 | || map->nodrop |
780 | || ms ().move_block == MOVE_ALL) |
781 | || ms ().move_block == MOVE_ALL) |
781 | { |
782 | { |
782 | while (inv) |
783 | while (inv) |
783 | { |
784 | { |
784 | inv->destroy_inv (drop_to_ground); |
785 | inv->destroy_inv (drop_to_ground); |
… | |
… | |
900 | * This function removes the object op from the linked list of objects |
901 | * This function removes the object op from the linked list of objects |
901 | * which it is currently tied to. When this function is done, the |
902 | * which it is currently tied to. When this function is done, the |
902 | * object will have no environment. If the object previously had an |
903 | * object will have no environment. If the object previously had an |
903 | * environment, the x and y coordinates will be updated to |
904 | * environment, the x and y coordinates will be updated to |
904 | * the previous environment. |
905 | * the previous environment. |
905 | * Beware: This function is called from the editor as well! |
|
|
906 | */ |
906 | */ |
907 | void |
907 | void |
908 | object::remove_slow () |
908 | object::remove_slow () |
909 | { |
909 | { |
910 | object *tmp, *last = 0; |
910 | object *tmp, *last = 0; |
… | |
… | |
1967 | } |
1967 | } |
1968 | |
1968 | |
1969 | if (!index) |
1969 | if (!index) |
1970 | return -1; |
1970 | return -1; |
1971 | |
1971 | |
1972 | return altern[RANDOM () % index]; |
1972 | return altern [rndm (index)]; |
1973 | } |
1973 | } |
1974 | |
1974 | |
1975 | /* |
1975 | /* |
1976 | * find_first_free_spot(archetype, maptile, x, y) works like |
1976 | * find_first_free_spot(archetype, maptile, x, y) works like |
1977 | * find_free_spot(), but it will search max number of squares. |
1977 | * find_free_spot(), but it will search max number of squares. |
… | |
… | |
1998 | { |
1998 | { |
1999 | arr += begin; |
1999 | arr += begin; |
2000 | end -= begin; |
2000 | end -= begin; |
2001 | |
2001 | |
2002 | while (--end) |
2002 | while (--end) |
2003 | swap (arr [end], arr [RANDOM () % (end + 1)]); |
2003 | swap (arr [end], arr [rndm (end + 1)]); |
2004 | } |
2004 | } |
2005 | |
2005 | |
2006 | /* new function to make monster searching more efficient, and effective! |
2006 | /* new function to make monster searching more efficient, and effective! |
2007 | * This basically returns a randomized array (in the passed pointer) of |
2007 | * This basically returns a randomized array (in the passed pointer) of |
2008 | * the spaces to find monsters. In this way, it won't always look for |
2008 | * the spaces to find monsters. In this way, it won't always look for |