From ee8bd34bb330ba257c13988b3f204ce4611c67ba Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Fri, 17 Apr 2009 01:43:45 +0000 Subject: [PATCH] Renamed at_pre_destroy() to at_object_destruction() to be consistent with at_object_creation() and at_player_creation(). Added additional documentation as well. --- src/commands/objmanip.py | 2 +- src/script_parents/basicobject.py | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/commands/objmanip.py b/src/commands/objmanip.py index 89eadb17b4..a1eca8d546 100644 --- a/src/commands/objmanip.py +++ b/src/commands/objmanip.py @@ -753,7 +753,7 @@ def cmd_destroy(command): return # Run any scripted things that happen before destruction. - target_obj.scriptlink.at_pre_destroy(pobject=source_object) + target_obj.scriptlink.at_object_destruction(pobject=source_object) # Notify destroyer and do the deed. source_object.emit_to("You destroy %s." % target_obj.get_name()) diff --git a/src/script_parents/basicobject.py b/src/script_parents/basicobject.py index 738c984749..5a3c53cc82 100644 --- a/src/script_parents/basicobject.py +++ b/src/script_parents/basicobject.py @@ -33,10 +33,12 @@ class EvenniaBasicObject(object): is created, do it here and not in __init__(). """ pass - - def at_desc(self, pobject=None): + + def at_object_destruction(self, pobject=None): """ - Perform this action when someone uses the LOOK command on the object. + This is triggered when an object is about to be destroyed via + @destroy ONLY. If an object is deleted via delete(), it is assumed + that this method is to be skipped. values: * pobject: (Object) The object requesting the action. @@ -44,10 +46,10 @@ class EvenniaBasicObject(object): # Un-comment the line below for an example #print "SCRIPT TEST: %s looked at %s." % (pobject, self.scripted_obj) pass - - def at_pre_destroy(self, pobject=None): + + def at_desc(self, pobject=None): """ - Performed right before an object is destroyed. + Perform this action when someone uses the LOOK command on the object. values: * pobject: (Object) The object requesting the action.