--- deliantra/server/common/object.C 2007/01/26 20:59:56 1.123 +++ deliantra/server/common/object.C 2007/02/05 01:24:45 1.128 @@ -821,7 +821,15 @@ remove_button_link (this); if (flag [FLAG_FRIENDLY]) - remove_friendly_object (this); + { + remove_friendly_object (this); + + if (type == GOLEM + && owner + && owner->type == PLAYER + && owner->contr->ranges[range_golem] == this) + owner->contr->ranges[range_golem] = 0; + } if (!flag [FLAG_REMOVED]) remove (); @@ -905,7 +913,7 @@ * the previous environment. */ void -object::remove_slow () +object::do_remove () { object *tmp, *last = 0; object *otmp; @@ -1969,7 +1977,7 @@ if (!index) return -1; - return altern[RANDOM () % index]; + return altern [rndm (index)]; } /* @@ -2000,7 +2008,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! @@ -2572,7 +2580,7 @@ char info2[256 * 4]; char *p = info; - p += snprintf (p, 512, "{cnt:%d,uuid:<1,%" PRIx64 ">,name:\"%s\"%s%s,flags:[%s],type:%d}", + p += snprintf (p, 512, "{cnt:%d,uuid:<1.%" PRIx64 ">,name:\"%s\"%s%s,flags:[%s],type:%d}", count, uuid.seq, &name, title ? "\",title:\"" : "", @@ -2602,3 +2610,10 @@ return debug_desc (info); } +struct region * +object::region () const +{ + return map ? map->region (x, y) + : region::default_region (); +} +