aster2013 %!s(int64=11) %!d(string=hai) anos
pai
achega
ff91be64ad
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      Source/Urho3D/LuaScript/LuaScript.cpp

+ 4 - 4
Source/Urho3D/LuaScript/LuaScript.cpp

@@ -164,7 +164,7 @@ void LuaScript::AddEventHandler(Object* sender, const String& eventName, int fun
         return;
         return;
 
 
     WeakPtr<LuaFunction> function = GetFunction(functionIndex);
     WeakPtr<LuaFunction> function = GetFunction(functionIndex);
-    if (!function)
+    if (function)
         eventInvoker_->AddEventHandler(sender, eventName, function);
         eventInvoker_->AddEventHandler(sender, eventName, function);
 }
 }
 
 
@@ -174,7 +174,7 @@ void LuaScript::AddEventHandler(Object* sender, const String& eventName, const S
         return;
         return;
 
 
     WeakPtr<LuaFunction> function = GetFunction(functionName);
     WeakPtr<LuaFunction> function = GetFunction(functionName);
-    if (!function)
+    if (function)
         eventInvoker_->AddEventHandler(sender, eventName, function);
         eventInvoker_->AddEventHandler(sender, eventName, function);
 }
 }
 
 
@@ -203,7 +203,7 @@ void LuaScript::RemoveEventHandler(Object* sender, const String& eventName, int
         return;
         return;
 
 
     WeakPtr<LuaFunction> function = GetFunction(functionIndex);
     WeakPtr<LuaFunction> function = GetFunction(functionIndex);
-    if (!function)
+    if (function)
         eventInvoker_->RemoveEventHandler(sender, eventName, function);
         eventInvoker_->RemoveEventHandler(sender, eventName, function);
 }
 }
 
 
@@ -213,7 +213,7 @@ void LuaScript::RemoveEventHandler(Object* sender, const String& eventName, cons
         return;
         return;
 
 
     WeakPtr<LuaFunction> function = GetFunction(functionName);
     WeakPtr<LuaFunction> function = GetFunction(functionName);
-    if (!function)
+    if (function)
         eventInvoker_->RemoveEventHandler(sender, eventName, function);
         eventInvoker_->RemoveEventHandler(sender, eventName, function);
 }
 }