mirror of
https://github.com/evennia/evennia.git
synced 2026-03-25 09:16:32 +01:00
Added at_object_creation_copy hook to DefaultObject.
This commit is contained in:
parent
b961f282c2
commit
f299964441
1 changed files with 16 additions and 1 deletions
|
|
@ -959,7 +959,22 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)):
|
|||
if obj.key.startswith(key) and obj.key.lstrip(key).isdigit())
|
||||
return "%s%03i" % (key, num)
|
||||
new_key = new_key or find_clone_key()
|
||||
return ObjectDB.objects.copy_object(self, new_key=new_key)
|
||||
new_obj = ObjectDB.objects.copy_object(self, new_key=new_key)
|
||||
new_obj.at_object_creation_copy(self)
|
||||
return new_obj
|
||||
|
||||
def at_object_creation_copy(self, source_obj):
|
||||
"""
|
||||
Called by DefaultObject.copy(). Meant to be overloaded. In case there's extra data not covered by
|
||||
.copy(), this can be used to deal with it.
|
||||
|
||||
Args:
|
||||
source_obj (Object): The Object this was copied from.
|
||||
|
||||
Returns:
|
||||
None
|
||||
"""
|
||||
pass
|
||||
|
||||
def delete(self):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue