aster2013 11 years ago
parent
commit
ff91be64ad
1 changed files with 4 additions and 4 deletions
  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;
 
     WeakPtr<LuaFunction> function = GetFunction(functionIndex);
-    if (!function)
+    if (function)
         eventInvoker_->AddEventHandler(sender, eventName, function);
 }
 
@@ -174,7 +174,7 @@ void LuaScript::AddEventHandler(Object* sender, const String& eventName, const S
         return;
 
     WeakPtr<LuaFunction> function = GetFunction(functionName);
-    if (!function)
+    if (function)
         eventInvoker_->AddEventHandler(sender, eventName, function);
 }
 
@@ -203,7 +203,7 @@ void LuaScript::RemoveEventHandler(Object* sender, const String& eventName, int
         return;
 
     WeakPtr<LuaFunction> function = GetFunction(functionIndex);
-    if (!function)
+    if (function)
         eventInvoker_->RemoveEventHandler(sender, eventName, function);
 }
 
@@ -213,7 +213,7 @@ void LuaScript::RemoveEventHandler(Object* sender, const String& eventName, cons
         return;
 
     WeakPtr<LuaFunction> function = GetFunction(functionName);
-    if (!function)
+    if (function)
         eventInvoker_->RemoveEventHandler(sender, eventName, function);
 }