Fixes for scanner and weapon range issues in scripts (submitted by Kaks).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1347 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
6894d2669e
commit
51d4b0f5c5
@ -678,6 +678,9 @@ static PlayerEntity *sSharedPlayer = nil;
|
|||||||
port_weapon = [(NSNumber *)[dict objectForKey:@"port_weapon"] intValue];
|
port_weapon = [(NSNumber *)[dict objectForKey:@"port_weapon"] intValue];
|
||||||
if ([dict objectForKey:@"starboard_weapon"])
|
if ([dict objectForKey:@"starboard_weapon"])
|
||||||
starboard_weapon = [(NSNumber *)[dict objectForKey:@"starboard_weapon"] intValue];
|
starboard_weapon = [(NSNumber *)[dict objectForKey:@"starboard_weapon"] intValue];
|
||||||
|
|
||||||
|
[self setWeaponDataFromType:forward_weapon];
|
||||||
|
scannerRange = SCANNER_MAX_RANGE;
|
||||||
|
|
||||||
missiles = [dict unsignedIntForKey:@"missiles"];
|
missiles = [dict unsignedIntForKey:@"missiles"];
|
||||||
// sanity check the number of missiles...
|
// sanity check the number of missiles...
|
||||||
@ -936,6 +939,8 @@ static PlayerEntity *sSharedPlayer = nil;
|
|||||||
aft_weapon = WEAPON_NONE;
|
aft_weapon = WEAPON_NONE;
|
||||||
port_weapon = WEAPON_NONE;
|
port_weapon = WEAPON_NONE;
|
||||||
starboard_weapon = WEAPON_NONE;
|
starboard_weapon = WEAPON_NONE;
|
||||||
|
[self setWeaponDataFromType:forward_weapon];
|
||||||
|
scannerRange = SCANNER_MAX_RANGE;
|
||||||
|
|
||||||
max_cargo = 20; // will be reset later
|
max_cargo = 20; // will be reset later
|
||||||
|
|
||||||
@ -1052,6 +1057,8 @@ static PlayerEntity *sSharedPlayer = nil;
|
|||||||
|
|
||||||
forward_weapon_type = StringToWeaponType([shipDict stringForKey:@"forward_weapon_type" defaultValue:@"WEAPON_NONE"]);
|
forward_weapon_type = StringToWeaponType([shipDict stringForKey:@"forward_weapon_type" defaultValue:@"WEAPON_NONE"]);
|
||||||
aft_weapon_type = StringToWeaponType([shipDict stringForKey:@"aft_weapon_type" defaultValue:@"WEAPON_NONE"]);
|
aft_weapon_type = StringToWeaponType([shipDict stringForKey:@"aft_weapon_type" defaultValue:@"WEAPON_NONE"]);
|
||||||
|
[self setWeaponDataFromType:forward_weapon_type];
|
||||||
|
scannerRange = SCANNER_MAX_RANGE;
|
||||||
|
|
||||||
missiles = [shipDict doubleForKey:@"missiles"];
|
missiles = [shipDict doubleForKey:@"missiles"];
|
||||||
has_ecm = [shipDict fuzzyBooleanForKey:@"has_ecm"];
|
has_ecm = [shipDict fuzzyBooleanForKey:@"has_ecm"];
|
||||||
|
@ -162,6 +162,7 @@ static NSString * const kOOLogEntityBehaviourChanged = @"entity.behaviour.change
|
|||||||
|
|
||||||
forward_weapon_type = StringToWeaponType([shipDict stringForKey:@"forward_weapon_type" defaultValue:@"WEAPON_NONE"]);
|
forward_weapon_type = StringToWeaponType([shipDict stringForKey:@"forward_weapon_type" defaultValue:@"WEAPON_NONE"]);
|
||||||
aft_weapon_type = StringToWeaponType([shipDict stringForKey:@"aft_weapon_type" defaultValue:@"WEAPON_NONE"]);
|
aft_weapon_type = StringToWeaponType([shipDict stringForKey:@"aft_weapon_type" defaultValue:@"WEAPON_NONE"]);
|
||||||
|
[self setWeaponDataFromType:forward_weapon_type];
|
||||||
|
|
||||||
weapon_energy = [shipDict floatForKey:@"weapon_energy"];
|
weapon_energy = [shipDict floatForKey:@"weapon_energy"];
|
||||||
scannerRange = [shipDict floatForKey:@"scanner_range" defaultValue:25600.0];
|
scannerRange = [shipDict floatForKey:@"scanner_range" defaultValue:25600.0];
|
||||||
|
@ -326,7 +326,7 @@ static JSBool ShipGetProperty(JSContext *context, JSObject *this, jsval name, js
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case kShip_scannerRange:
|
case kShip_scannerRange:
|
||||||
JS_NewDoubleValue(context, [entity weaponRange], outValue);
|
JS_NewDoubleValue(context, [entity scannerRange], outValue);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kShip_reportAIMessages:
|
case kShip_reportAIMessages:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user