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.56 by root, Sun Dec 3 02:04:57 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 = new maptile;
931
932 freed_map->name = "/internal/freed_objects_map";
933 freed_map->width = 3;
934 freed_map->height = 3;
935
936 freed_map->allocate ();
937 }
938
939 map = freed_map;
940 x = 1;
941 y = 1;
942 }
943 915
944 if (more) 916 if (more)
945 { 917 {
946 more->destroy (destroy_inventory); 918 more->destroy (destroy_inventory);
947 more = 0; 919 more = 0;
986 958
987 op = tmp; 959 op = tmp;
988 } 960 }
989 } 961 }
990 } 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 }
991 983
992 // clear those pointers that likely might have circular references to us 984 // clear those pointers that likely might have circular references to us
993 owner = 0; 985 owner = 0;
994 enemy = 0; 986 enemy = 0;
995 attacked_by = 0; 987 attacked_by = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines