--- deliantra/server/common/object.C 2007/01/23 03:17:55 1.121 +++ deliantra/server/common/object.C 2007/01/27 23:59:29 1.125 @@ -777,6 +777,7 @@ if (!drop_to_ground || !map || map->in_memory != MAP_IN_MEMORY + || map->nodrop || ms ().move_block == MOVE_ALL) { while (inv) @@ -902,7 +903,6 @@ * object will have no environment. If the object previously had an * environment, the x and y coordinates will be updated to * the previous environment. - * Beware: This function is called from the editor as well! */ void object::remove_slow () @@ -1969,7 +1969,7 @@ if (!index) return -1; - return altern[RANDOM () % index]; + return altern [rndm (index)]; } /* @@ -2000,7 +2000,7 @@ end -= begin; while (--end) - swap (arr [end], arr [RANDOM () % (end + 1)]); + swap (arr [end], arr [rndm (end + 1)]); } /* new function to make monster searching more efficient, and effective! @@ -2602,3 +2602,10 @@ return debug_desc (info); } +struct region * +object::region () const +{ + return map ? map->region (x, y) + : region::default_region (); +} +