From c5af9b124b47d738d244707155215ce8827b03a7 Mon Sep 17 00:00:00 2001 From: Jens Ayton Date: Mon, 3 Nov 2008 21:48:41 +0000 Subject: [PATCH] Enable docking clearance for non-debug Mac builds (oops). Fixed a potential crash when calling JS player.ship.setGalacticHyperspaceBehaviour() with an invalid argument. git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1829 127b21dd-08f5-0310-b4b7-95ae10353056 --- Oolite.xcodeproj/project.pbxproj | 7 ++++++- src/Core/Scripting/OOJSPlayerShip.m | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Oolite.xcodeproj/project.pbxproj b/Oolite.xcodeproj/project.pbxproj index 5452cdfc..d94d407a 100644 --- a/Oolite.xcodeproj/project.pbxproj +++ b/Oolite.xcodeproj/project.pbxproj @@ -3421,6 +3421,7 @@ GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = XP_UNIX; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ( + DOCKING_CLEARANCE_ENABLED, NDEBUG, OO_EXCLUDE_DEBUG_SUPPORT, ); @@ -3538,7 +3539,10 @@ GCC_ENABLE_FIX_AND_CONTINUE = NO; GCC_OPTIMIZATION_LEVEL = s; GCC_PREPROCESSOR_DEFINITIONS = XP_UNIX; - GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "OO_SMART_CRASH_REPORT_INSTALL=1"; + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ( + DOCKING_CLEARANCE_ENABLED, + "OO_SMART_CRASH_REPORT_INSTALL=1", + ); GCC_REUSE_STRINGS = YES; GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -3654,6 +3658,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = XP_UNIX; GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ( + DOCKING_CLEARANCE_ENABLED, OO_DEBUG, DEBUG_GRAPHVIZ, DEBUG, diff --git a/src/Core/Scripting/OOJSPlayerShip.m b/src/Core/Scripting/OOJSPlayerShip.m index 931cc8c2..5d3742bf 100644 --- a/src/Core/Scripting/OOJSPlayerShip.m +++ b/src/Core/Scripting/OOJSPlayerShip.m @@ -579,6 +579,7 @@ static JSBool PlayerShipSetGalacticHyperspaceBehaviour(JSContext *context, JSObj if (behaviour == GALACTIC_HYPERSPACE_BEHAVIOUR_UNKNOWN) { OOReportJSErrorForCaller(context, @"PlayerShip", @"setGalacticHyperspaceBehaviour", @"Unknown galactic hyperspace behaviour name %@.", behavString); + return NO; } [player setGalacticHyperspaceBehaviour:behaviour];