From 4e25c938889d35e305039180354370886a9cef59 Mon Sep 17 00:00:00 2001 From: BattleJenkins Date: Wed, 22 Mar 2017 00:19:58 -0700 Subject: [PATCH] Added at_give() hook to default object Added another hook to the default object, at_give(), which will be called by the default give command. --- evennia/objects/objects.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/evennia/objects/objects.py b/evennia/objects/objects.py index d2934f4dfc..cf90321692 100644 --- a/evennia/objects/objects.py +++ b/evennia/objects/objects.py @@ -1416,6 +1416,22 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): """ pass + + def at_give(self, giver, getter): + """ + Called by the default `give` command when this object has been + given. + + Args: + giver (Object): The object giving this object. + getter (Object): The object getting this object. + + Notes: + This hook cannot stop the give from happening. Use + permissions for that. + + """ + pass def at_drop(self, dropper): """ @@ -1426,7 +1442,7 @@ class DefaultObject(with_metaclass(TypeclassBase, ObjectDB)): dropper (Object): The object which just dropped this object. Notes: - This hook cannot stop the pickup from happening. Use + This hook cannot stop the drop from happening. Use permissions from that. """