From 5f518f0c5f6cf3edd67a129120b3e43bd70a391e Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Tue, 2 Oct 2012 21:44:43 +0000 Subject: [PATCH] Fix bug where callObjC() missclassified methods taking an object and returning an object. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5392 127b21dd-08f5-0310-b4b7-95ae10353056 --- src/Core/Scripting/OOJSCall.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Core/Scripting/OOJSCall.m b/src/Core/Scripting/OOJSCall.m index 741a2ab5..6f8f8329 100644 --- a/src/Core/Scripting/OOJSCall.m +++ b/src/Core/Scripting/OOJSCall.m @@ -103,7 +103,7 @@ BOOL OOJSCallObjCObjectMethod(JSContext *context, id object, NSString *oo_jsClas [PLAYER setScriptTarget:object]; } - selectorString = OOStringFromJSValue(context,argv[0]); + selectorString = OOStringFromJSValue(context, argv[0]); // Join all parameters together with spaces. if (1 < argc && [selectorString hasSuffix:@":"]) @@ -226,13 +226,14 @@ static BOOL SignatureMatch(NSMethodSignature *sig, SEL selector) static MethodType GetMethodType(id object, SEL selector) { NSMethodSignature *sig = [object methodSignatureForSelector:selector]; - MethodType type = (MethodType)OOShaderUniformTypeFromMethodSignature(sig); - if (type != kMethodTypeInvalid) return type; if (SignatureMatch(sig, @selector(voidVoidMethod))) return kMethodTypeVoidVoid; if (SignatureMatch(sig, @selector(voidObjectMethod:))) return kMethodTypeVoidObject; if (SignatureMatch(sig, @selector(objectObjectMethod:))) return kMethodTypeObjectObject; + MethodType type = (MethodType)OOShaderUniformTypeFromMethodSignature(sig); + if (type != kMethodTypeInvalid) return type; + return kMethodTypeInvalid; }