… | |
… | |
819 | |
819 | |
820 | if (flag [FLAG_IS_LINKED]) |
820 | if (flag [FLAG_IS_LINKED]) |
821 | remove_button_link (this); |
821 | remove_button_link (this); |
822 | |
822 | |
823 | if (flag [FLAG_FRIENDLY]) |
823 | if (flag [FLAG_FRIENDLY]) |
|
|
824 | { |
824 | remove_friendly_object (this); |
825 | remove_friendly_object (this); |
|
|
826 | |
|
|
827 | if (type == GOLEM |
|
|
828 | && owner |
|
|
829 | && owner->type == PLAYER |
|
|
830 | && owner->contr->ranges[range_golem] == this) |
|
|
831 | owner->contr->ranges[range_golem] = 0; |
|
|
832 | } |
825 | |
833 | |
826 | if (!flag [FLAG_REMOVED]) |
834 | if (!flag [FLAG_REMOVED]) |
827 | remove (); |
835 | remove (); |
828 | |
836 | |
829 | destroy_inv (true); |
837 | destroy_inv (true); |
… | |
… | |
903 | * object will have no environment. If the object previously had an |
911 | * object will have no environment. If the object previously had an |
904 | * environment, the x and y coordinates will be updated to |
912 | * environment, the x and y coordinates will be updated to |
905 | * the previous environment. |
913 | * the previous environment. |
906 | */ |
914 | */ |
907 | void |
915 | void |
908 | object::remove_slow () |
916 | object::do_remove () |
909 | { |
917 | { |
910 | object *tmp, *last = 0; |
918 | object *tmp, *last = 0; |
911 | object *otmp; |
919 | object *otmp; |
912 | |
920 | |
913 | if (QUERY_FLAG (this, FLAG_REMOVED)) |
921 | if (QUERY_FLAG (this, FLAG_REMOVED)) |
… | |
… | |
2570 | { |
2578 | { |
2571 | char flagdesc[512]; |
2579 | char flagdesc[512]; |
2572 | char info2[256 * 4]; |
2580 | char info2[256 * 4]; |
2573 | char *p = info; |
2581 | char *p = info; |
2574 | |
2582 | |
2575 | p += snprintf (p, 512, "{cnt:%d,uuid:<1,%" PRIx64 ">,name:\"%s\"%s%s,flags:[%s],type:%d}", |
2583 | p += snprintf (p, 512, "{cnt:%d,uuid:<1.%" PRIx64 ">,name:\"%s\"%s%s,flags:[%s],type:%d}", |
2576 | count, uuid.seq, |
2584 | count, uuid.seq, |
2577 | &name, |
2585 | &name, |
2578 | title ? "\",title:\"" : "", |
2586 | title ? "\",title:\"" : "", |
2579 | title ? (const char *)title : "", |
2587 | title ? (const char *)title : "", |
2580 | flag_desc (flagdesc, 512), type); |
2588 | flag_desc (flagdesc, 512), type); |
… | |
… | |
2607 | { |
2615 | { |
2608 | return map ? map->region (x, y) |
2616 | return map ? map->region (x, y) |
2609 | : region::default_region (); |
2617 | : region::default_region (); |
2610 | } |
2618 | } |
2611 | |
2619 | |
|
|
2620 | const materialtype_t * |
|
|
2621 | object::dominant_material () const |
|
|
2622 | { |
|
|
2623 | if (materialtype_t *mat = name_to_material (materialname)) |
|
|
2624 | return mat; |
|
|
2625 | |
|
|
2626 | // omfg this is slow, this has to be temporary :) |
|
|
2627 | shstr unknown ("unknown"); |
|
|
2628 | |
|
|
2629 | return name_to_material (unknown); |
|
|
2630 | } |
|
|
2631 | |