Make ship.entityPersonality writable
Use a fixed personality on the "new game" screen to stop flickering with certain shipset OXPs
This commit is contained in:
parent
279321ecc9
commit
9153f5b968
@ -136,6 +136,7 @@ Properties:
|
||||
just player
|
||||
* ship.scannerHostileDisplayColor1, ship.scannerHostileDisplayColor2
|
||||
* ship.subEntityRotation
|
||||
* ship.entityPersonality is now writable
|
||||
* equipmentInfo.provides
|
||||
* player.ship.forwardShield, player.ship.maxForwardShield,
|
||||
player.ship.forwardShieldRechargeRate, player.ship.aftShield,
|
||||
|
@ -277,7 +277,7 @@ static uint16_t PersonalityForCommanderDict(NSDictionary *dict);
|
||||
|
||||
- (void) addScenarioModel:(NSString *)shipKey
|
||||
{
|
||||
[self showShipModelWithKey:shipKey shipData:nil personality:ENTITY_PERSONALITY_INVALID factorX:1.2 factorY:0.8 factorZ:6.4 inContext:@"scenario"];
|
||||
[self showShipModelWithKey:shipKey shipData:nil personality:0 factorX:1.2 factorY:0.8 factorZ:6.4 inContext:@"scenario"];
|
||||
}
|
||||
|
||||
|
||||
|
@ -367,7 +367,7 @@ static JSPropertySpec sShipProperties[] =
|
||||
{ "displayName", kShip_displayName, OOJS_PROP_READWRITE_CB },
|
||||
{ "dockingInstructions", kShip_dockingInstructions, OOJS_PROP_READONLY_CB },
|
||||
{ "energyRechargeRate", kShip_energyRechargeRate, OOJS_PROP_READWRITE_CB },
|
||||
{ "entityPersonality", kShip_entityPersonality, OOJS_PROP_READONLY_CB },
|
||||
{ "entityPersonality", kShip_entityPersonality, OOJS_PROP_READWRITE_CB },
|
||||
{ "equipment", kShip_equipment, OOJS_PROP_READONLY_CB },
|
||||
{ "escorts", kShip_escorts, OOJS_PROP_READONLY_CB },
|
||||
{ "escortGroup", kShip_escortGroup, OOJS_PROP_READONLY_CB },
|
||||
@ -1342,6 +1342,18 @@ static JSBool ShipSetProperty(JSContext *context, JSObject *this, jsid propID, J
|
||||
}
|
||||
break;
|
||||
|
||||
case kShip_entityPersonality:
|
||||
if (JS_ValueToInt32(context, *value, &iValue))
|
||||
{
|
||||
if (iValue < 0 || iValue > ENTITY_PERSONALITY_MAX)
|
||||
{
|
||||
OOJSReportError(context, @"ship.%@ must be >= 0 and <= %u.", OOStringFromJSPropertyIDAndSpec(context, propID, sShipProperties),ENTITY_PERSONALITY_MAX);
|
||||
return NO;
|
||||
}
|
||||
[entity setEntityPersonalityInt: iValue];
|
||||
return YES;
|
||||
}
|
||||
|
||||
case kShip_hyperspaceSpinTime:
|
||||
if (JS_ValueToNumber(context, *value, &fValue))
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user