|
|
@@ -174,9 +174,7 @@ void LuaScript::ScriptSubscribeToEvent(const String& eventName, const String& fu
|
|
|
{
|
|
|
LuaFunctionVector& functions = eventHandleFunctions_[eventType];
|
|
|
|
|
|
- HashSet<Object*>* receivers = context_->GetEventReceivers(eventType);
|
|
|
- if (!receivers || !receivers->Contains(this))
|
|
|
- SubscribeToEvent(eventType, HANDLER(LuaScript, HandleEvent));
|
|
|
+ SubscribeToEvent(eventType, HANDLER(LuaScript, HandleEvent));
|
|
|
|
|
|
if (!functions.Contains(function))
|
|
|
functions.Push(function);
|
|
|
@@ -225,15 +223,10 @@ void LuaScript::ScriptSubscribeToEvent(void* sender, const String& eventName, co
|
|
|
{
|
|
|
LuaFunctionVector& functions = objectHandleFunctions_[object][eventType];
|
|
|
|
|
|
- HashSet<Object*>* receivers = context_->GetEventReceivers(object, eventType);
|
|
|
- if (!receivers || !receivers->Contains(this))
|
|
|
- {
|
|
|
- SubscribeToEvent(object, eventType, HANDLER(LuaScript, HandleObjectEvent));
|
|
|
-
|
|
|
- // Fix issue #256
|
|
|
- if (!functions.Empty())
|
|
|
- functions.Clear();
|
|
|
- }
|
|
|
+ SubscribeToEvent(object, eventType, HANDLER(LuaScript, HandleObjectEvent));
|
|
|
+
|
|
|
+ if (!functions.Empty())
|
|
|
+ functions.Clear();
|
|
|
|
|
|
if (!functions.Contains(function))
|
|
|
functions.Push(function);
|