Fixed bug that had recycled objects not properly forget flags set on them before they were destroyed.

/Griatch
This commit is contained in:
Griatch 2009-09-27 16:36:03 +00:00
parent 0e46a61c85
commit 45ba9ea73c
2 changed files with 37 additions and 28 deletions

View file

@ -384,16 +384,17 @@ class ObjectManager(models.Manager):
#get_nextfree_dbnum() returns either an integer or an old object to recycle.
next_dbref = self.get_nextfree_dbnum()
if type(next_dbref) == type(int()):
if type(next_dbref) == type(int()):
#create new object with a fresh dbref
Object = ContentType.objects.get(app_label="objects",
model="object").model_class()
new_object = Object()
new_object.id = next_dbref
else:
#recycle an old object instead
#recycle an old object's id instead
new_object = next_dbref
new_object.purge_object()
new_object.type = otype
new_object.set_name(name)