File tree Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Expand file tree Collapse file tree 3 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,6 @@ def set_own_val(self, oldValue):
88
88
class PlayerAvatar (Avatar , EventHandler ):
89
89
def __init__ (self ): # 这里引擎不会自动调用
90
90
EventHandler .__init__ (self )
91
- self .registerEvents ()
92
-
93
- def registerEvents (self ):
94
- """
95
- 注册事件监听
96
- """
97
- kbesystem .eventMgr .registerEventHandler ("TargetMgr.onTargetChanged" , self .onTargetChanged )
98
91
99
92
def onTargetChanged (self , _preTargetID , _currTargetID ):
100
93
"""
Original file line number Diff line number Diff line change @@ -80,9 +80,28 @@ Entity::~Entity()
80
80
{
81
81
enterword_ = false ;
82
82
ENTITY_DECONSTRUCTION (Entity);
83
+ S_RELEASE (cellMailbox_);
84
+ S_RELEASE (baseMailbox_);
85
+
83
86
script::PyGC::decTracing (" Entity" );
87
+
88
+ if (pClientApp_->pEntities ())
89
+ pClientApp_->pEntities ()->pGetbages ()->erase (id ());
90
+
91
+ Py_DECREF (pClientApp_);
84
92
}
85
93
94
+ // -------------------------------------------------------------------------------------
95
+ void Entity::pClientApp (ClientObjectBase* p)
96
+ {
97
+ if (p)
98
+ Py_INCREF (p);
99
+ else
100
+ Py_DECREF (pClientApp_);
101
+
102
+ pClientApp_ = p;
103
+ }
104
+
86
105
// -------------------------------------------------------------------------------------
87
106
PyObject* Entity::pyGetBaseMailbox ()
88
107
{
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ class Entity : public script::ScriptObject
111
111
pClientApp section
112
112
*/
113
113
DECLARE_PY_GET_MOTHOD (pyGetClientApp);
114
- INLINE void pClientApp (ClientObjectBase* p);
114
+ void pClientApp (ClientObjectBase* p);
115
115
INLINE ClientObjectBase* pClientApp ()const ;
116
116
117
117
const EntityAspect* getAspect ()const { return &aspect_; }
You can’t perform that action at this time.
0 commit comments