New JS property: ship.markedForFines (bool, ro)

This commit is contained in:
cim 2013-07-18 20:55:05 +01:00
parent 5db0182765
commit 7c6f7b9a6e
3 changed files with 13 additions and 0 deletions

View File

@ -1062,6 +1062,7 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q
- (void) receiveCommsMessage:(NSString *) message_text from:(ShipEntity *) other;
- (void) commsMessage:(NSString *)valueString withUnpilotedOverride:(BOOL)unpilotedOverride;
- (BOOL) markedForFines;
- (BOOL) markForFines;
- (BOOL) isMining;

View File

@ -12607,6 +12607,12 @@ static BOOL AuthorityPredicate(Entity *entity, void *parameter)
}
- (BOOL) markedForFines
{
return being_fined;
}
- (BOOL) markForFines
{
if (being_fined)

View File

@ -218,6 +218,7 @@ enum
kShip_laserHeatLevelPort, // port laser temperature, float, read-only
kShip_laserHeatLevelStarboard, // starboard laser temperature, float, read-only
kShip_lightsActive, // flasher/shader light flag, boolean, read/write
kShip_markedForFines, // has been marked for fines
kShip_maxEscorts, // maximum escort count, int, read/write
kShip_maxPitch, // maximum flight pitch, double, read-only
kShip_maxSpeed, // maximum flight speed, double, read-only
@ -344,6 +345,7 @@ static JSPropertySpec sShipProperties[] =
{ "laserHeatLevelPort", kShip_laserHeatLevelPort, OOJS_PROP_READONLY_CB },
{ "laserHeatLevelStarboard", kShip_laserHeatLevelStarboard, OOJS_PROP_READONLY_CB },
{ "lightsActive", kShip_lightsActive, OOJS_PROP_READWRITE_CB },
{ "markedForFines", kShip_markedForFines, OOJS_PROP_READONLY_CB },
{ "maxEscorts", kShip_maxEscorts, OOJS_PROP_READWRITE_CB },
{ "maxPitch", kShip_maxPitch, OOJS_PROP_READONLY_CB },
{ "maxSpeed", kShip_maxSpeed, OOJS_PROP_READONLY_CB },
@ -751,6 +753,10 @@ static JSBool ShipGetProperty(JSContext *context, JSObject *this, jsid propID, j
case kShip_destination:
return HPVectorToJSValue(context, [entity destination], value);
case kShip_markedForFines:
*value = OOJSValueFromBOOL([entity markedForFines]);
return YES;
case kShip_maxEscorts:
return JS_NewNumberValue(context, [entity maxEscortCount], value);