ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/object.C
(Generate patch)

Comparing deliantra/server/common/object.C (file contents):
Revision 1.55 by root, Sun Dec 3 00:41:33 2006 UTC vs.
Revision 1.58 by pippijn, Mon Dec 4 17:48:35 2006 UTC

839 else 839 else
840 { 840 {
841 delete *i; 841 delete *i;
842 mortals.erase (i); 842 mortals.erase (i);
843 } 843 }
844
845 static int lastmortals = 0;//D
846
847 if (mortals.size() != lastmortals && lastmortals > 100)//D
848 {
849 lastmortals = mortals.size ();//D
850 LOG (llevDebug, "%d objects in mortal queue\n", lastmortals);//D
851 }
852} 844}
853 845
854object::object () 846object::object ()
855{ 847{
856 SET_FLAG (this, FLAG_REMOVED); 848 SET_FLAG (this, FLAG_REMOVED);
918 910
919 if (!QUERY_FLAG (this, FLAG_REMOVED)) 911 if (!QUERY_FLAG (this, FLAG_REMOVED))
920 remove_ob (this); 912 remove_ob (this);
921 913
922 SET_FLAG (this, FLAG_FREED); 914 SET_FLAG (this, FLAG_FREED);
923
924 // hack to ensure that freed objects still have a valid map
925 {
926 static maptile *freed_map; // freed objects are moved here to avoid crashes
927
928 if (!freed_map)
929 {
930 freed_map = get_empty_map (3, 3);
931 freed_map->name = "freed objects map";
932 allocate_map (freed_map);
933 }
934
935 map = freed_map;
936 x = 1;
937 y = 1;
938 }
939 915
940 if (more) 916 if (more)
941 { 917 {
942 more->destroy (destroy_inventory); 918 more->destroy (destroy_inventory);
943 more = 0; 919 more = 0;
982 958
983 op = tmp; 959 op = tmp;
984 } 960 }
985 } 961 }
986 } 962 }
963
964 // hack to ensure that freed objects still have a valid map
965 {
966 static maptile *freed_map; // freed objects are moved here to avoid crashes
967
968 if (!freed_map)
969 {
970 freed_map = new maptile;
971
972 freed_map->name = "/internal/freed_objects_map";
973 freed_map->width = 3;
974 freed_map->height = 3;
975
976 freed_map->allocate ();
977 }
978
979 map = freed_map;
980 x = 1;
981 y = 1;
982 }
987 983
988 // clear those pointers that likely might have circular references to us 984 // clear those pointers that likely might have circular references to us
989 owner = 0; 985 owner = 0;
990 enemy = 0; 986 enemy = 0;
991 attacked_by = 0; 987 attacked_by = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines