diff --git a/Resources/AIs/pirateAI.plist b/Resources/AIs/pirateAI.plist index aaa970a3..f4a615ab 100644 --- a/Resources/AIs/pirateAI.plist +++ b/Resources/AIs/pirateAI.plist @@ -162,7 +162,7 @@ "ODDS_GOOD" = (groupAttackTarget); "CARGO_SCOOPED" = ("setStateTo: CHECK_CARGO"); RESTARTED = ("setStateTo: LURK"); - UPDATE = (scanForRandomMerchantmen, "pauseAI: 10.0"); + UPDATE = (scanForRandomMerchantman, "pauseAI: 10.0"); }; LURK = { ENTER = ("setSpeedTo: 0.0", performIdle); @@ -177,7 +177,7 @@ "ODDS_LEVEL" = (groupAttackTarget); "GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); "ENTER WORMHOLE" = ("setStateTo: ENTER_WORMHOLE"); - UPDATE = (scanForRandomMerchantmen, "pauseAI: 5.0"); + UPDATE = (scanForRandomMerchantman, "pauseAI: 5.0"); }; "SCAN_FOR_LOOT" = { ENTER = ("setSpeedTo: 0.0", performIdle); @@ -197,7 +197,7 @@ "setSpeedFactorTo: 0.75", performFlyToRangeFromDestination ); - "DESIRED_RANGE_ACHIEVED" = (scanForRandomMerchantmen); + "DESIRED_RANGE_ACHIEVED" = (scanForRandomMerchantman); "NOTHING_FOUND" = ("setStateTo: TRAVEL_TO_LURK_AREA"); "TARGET_FOUND" = (groupAttackTarget); "GROUP_ATTACK_TARGET" = (setTargetToFoundTarget, "setStateTo: ATTACK_SHIP"); diff --git a/Resources/Config/pirate-victim-roles.plist b/Resources/Config/pirate-victim-roles.plist index b6172c51..5492f05b 100644 --- a/Resources/Config/pirate-victim-roles.plist +++ b/Resources/Config/pirate-victim-roles.plist @@ -1,7 +1,7 @@ /* List of roles pirates will attack. Ships whose primary role is among those listed can be located with the AI - methods scanForNearestMerchantmen and scanForRandomMerchantmen. They can + methods scanForNearestMerchantman and scanForRandomMerchantman. They can also be identified with the JavaScript property isPirateVictim. */ diff --git a/Resources/Config/whitelist.plist b/Resources/Config/whitelist.plist index 1917e033..23d55617 100644 --- a/Resources/Config/whitelist.plist +++ b/Resources/Config/whitelist.plist @@ -98,8 +98,8 @@ "performHold", "setTargetToPrimaryAggressor", "performAttack", - "scanForNearestMerchantmen", - "scanForRandomMerchantmen", + "scanForNearestMerchantman", + "scanForRandomMerchantman", "scanForLoot", "scanForRandomLoot", "setTargetToFoundTarget", @@ -438,5 +438,7 @@ "setStateMachine:" = "setAITo:"; "launchTrader" = ("launchIndependentShip:", "trader"); "launchIndependentShipWithRole:" = "launchIndependentShip:"; + "scanForNearestMerchantmen" = "scanForNearestMerchantman"; + "scanForRandomMerchantmen" = "scanForRandomMerchantman"; }; } diff --git a/Resources/Shaders/oolite-default-shader.fragment b/Resources/Shaders/oolite-default-shader.fragment index 29cb5643..82298ee3 100644 --- a/Resources/Shaders/oolite-default-shader.fragment +++ b/Resources/Shaders/oolite-default-shader.fragment @@ -78,10 +78,6 @@ #define OOSTD_EMISSION_AND_ILLUMINATION_MAP 0 #endif -#ifndef OO_LIGHT_0_FIX -#define OO_LIGHT_0_FIX 0 -#endif - #if OOSTD_EMISSION_AND_ILLUMINATION_MAP && !OOSTD_EMISSION_MAP #undef OOSTD_EMISSION_MAP @@ -116,10 +112,6 @@ varying vec3 vEyeVector; varying vec2 vTexCoord; -#if OO_LIGHT_0_FIX -varying vec3 vLight0Vector; -#endif - varying vec3 vLight1Vector; #if OOSTD_DIFFUSE_MAP && !OOSTD_DIFFUSE_MAP_IS_CUBE_MAP @@ -253,10 +245,7 @@ void main(void) #endif // Get light vectors -#if OO_LIGHT_0_FIX - vec3 light0Vector = normalize(vLight0Vector); -#endif - vec3 light1Vector = normalize(vLight1Vector); + vec3 lightVector = normalize(vLight1Vector); // Get ambient colour vec4 ambientLight = gl_LightModel.ambient; @@ -290,10 +279,7 @@ void main(void) #endif vec4 diffuseLight = vec4(0); -#if OO_LIGHT_0_FIX - diffuseLight += CalcDiffuseLight(light0Vector, normal, gl_LightSource[0].diffuse); -#endif - diffuseLight += CalcDiffuseLight(light1Vector, normal, gl_LightSource[1].diffuse); + diffuseLight += CalcDiffuseLight(lightVector, normal, gl_LightSource[1].diffuse); #if HAVE_ILLUMINATION diffuseLight += illuminationMapLight; @@ -310,17 +296,11 @@ void main(void) #endif // Calculate specular light -#if OOSTD_SPECULAR && OO_LIGHT_0_FIX - #define SPECULAR_LIGHT_0 specularLight += CalcSpecularLight(light0Vector, eyeVector, exponent, normal, gl_LightSource[0].specular) -#else - #define SPECULAR_LIGHT_0 -#endif #if OOSTD_SPECULAR vec4 specularLight = vec4(0); float exponent = gl_FrontMaterial.shininess; APPLY_MAPPED_EXPONENT; - SPECULAR_LIGHT_0; - specularLight += CalcSpecularLight(light1Vector, eyeVector, exponent, normal, gl_LightSource[1].specular); + specularLight += CalcSpecularLight(lightVector, eyeVector, exponent, normal, gl_LightSource[1].specular); specularLight.a = 1.0; #endif diff --git a/Resources/Shaders/oolite-tangent-space-vertex.vertex b/Resources/Shaders/oolite-tangent-space-vertex.vertex index c41a7f22..ffaf7298 100644 --- a/Resources/Shaders/oolite-tangent-space-vertex.vertex +++ b/Resources/Shaders/oolite-tangent-space-vertex.vertex @@ -26,17 +26,9 @@ attribute vec3 tangent; -#ifndef OO_LIGHT_0_FIX -#define OO_LIGHT_0_FIX 0 -#endif - - // No vNormal, because normal is always 0,0,1 in tangent space. varying vec3 vEyeVector; varying vec2 vTexCoord; -#if OO_LIGHT_0_FIX -varying vec3 vLight0Vector; -#endif varying vec3 vLight1Vector; #ifndef OOSTD_DIFFUSE_MAP_IS_CUBE_MAP @@ -60,13 +52,8 @@ void main(void) vec3 eyeVector = -vec3(gl_ModelViewMatrix * gl_Vertex); vEyeVector = eyeVector * TBN; -#if OO_LIGHT_0_FIX - vec3 light0Vector = gl_LightSource[0].position.xyz + eyeVector; - vLight0Vector = light0Vector * TBN; -#endif - - vec3 light1Vector = gl_LightSource[1].position.xyz + eyeVector; - vLight1Vector = light1Vector * TBN; + vec3 lightVector = gl_LightSource[1].position.xyz + eyeVector; + vLight1Vector = lightVector * TBN; vTexCoord = gl_MultiTexCoord0.st; diff --git a/src/Core/Entities/ShipEntityAI.m b/src/Core/Entities/ShipEntityAI.m index 5ea361db..190acb60 100644 --- a/src/Core/Entities/ShipEntityAI.m +++ b/src/Core/Entities/ShipEntityAI.m @@ -100,8 +100,8 @@ MA 02110-1301, USA. - (void) performAttack; -- (void) scanForNearestMerchantmen; -- (void) scanForRandomMerchantmen; +- (void) scanForNearestMerchantman; +- (void) scanForRandomMerchantman; - (void) scanForLoot; @@ -486,7 +486,7 @@ MA 02110-1301, USA. } -- (void) scanForNearestMerchantmen +- (void) scanForNearestMerchantman { float d2, found_d2; unsigned i; @@ -521,7 +521,7 @@ MA 02110-1301, USA. } -- (void) scanForRandomMerchantmen +- (void) scanForRandomMerchantman { unsigned n_found, i; diff --git a/src/Core/OOCacheManager.m b/src/Core/OOCacheManager.m index 2c524342..6d90ed46 100644 --- a/src/Core/OOCacheManager.m +++ b/src/Core/OOCacheManager.m @@ -75,7 +75,7 @@ static NSString * const kCacheKeyCaches = @"caches"; enum { kEndianTagValue = 0x0123456789ABCDEFULL, - kFormatVersionValue = 37 + kFormatVersionValue = 38 }; diff --git a/src/Core/Scripting/OOJSMission.m b/src/Core/Scripting/OOJSMission.m index ab75b3a7..a010f627 100644 --- a/src/Core/Scripting/OOJSMission.m +++ b/src/Core/Scripting/OOJSMission.m @@ -118,6 +118,7 @@ void InitOOJSMission(JSContext *context, JSObject *global) OO_AddJSGCRoot(context, &sCallbackThis, "Pending mission callback this"); } + void MissionRunCallback() { // don't do anything if we don't have a function.