diff --git a/doc/js-objects.md b/doc/js-objects.md index 2b8f7a5f97a..c1e04993072 100644 --- a/doc/js-objects.md +++ b/doc/js-objects.md @@ -25,7 +25,7 @@ In addition, the following properties are defined: * ```status``` The completeness status of the structure. It will be one of ```BEING_BUILT``` and ```BUILT```. * ```type``` The type will always be ```STRUCTURE```. * ```cost``` What it would cost to build this structure. (3.2+ only) -* ```direction``` The direction the structure is facing. (4.4+ only) +* ```direction``` The direction the structure is facing. (4.5+ only) * ```stattype``` The stattype defines the type of structure. It will be one of ```HQ```, ```FACTORY```, ```POWER_GEN```, ```RESOURCE_EXTRACTOR```, ```LASSAT```, ```DEFENSE```, ```WALL```, ```RESEARCH_LAB```, ```REPAIR_FACILITY```, ```CYBORG_FACTORY```, ```VTOL_FACTORY```, ```REARM_PAD```, ```SAT_UPLINK```, ```GATE``` and ```COMMAND_CONTROL```. @@ -94,7 +94,6 @@ the action directly, but it may be interesting to look at what it currently is. * ```experience``` Amount of experience this droid has, based on damage it has dealt to enemies. * ```cost``` What it would cost to build the droid. (3.2+ only) * ```isVTOL``` True if the droid is VTOL. (3.2+ only) -* ```isFlying``` True if the droid is currently flying. (4.4+ only) * ```canHitAir``` True if the droid has anti-air capabilities. (3.2+ only) * ```canHitGround``` True if the droid has anti-ground capabilities. (3.2+ only) * ```isSensor``` True if the droid has sensor ability. (3.2+ only) diff --git a/src/droid.cpp b/src/droid.cpp index 4b330c70308..7a44a5f9f37 100644 --- a/src/droid.cpp +++ b/src/droid.cpp @@ -2810,7 +2810,7 @@ bool isVtolDroid(const DROID *psDroid) bool isFlying(const DROID *psDroid) { return (asPropulsionStats + psDroid->asBits[COMP_PROPULSION])->propulsionType == PROPULSION_TYPE_LIFT - && psDroid->sMove.Status != MOVEINACTIVE; + && (psDroid->sMove.Status != MOVEINACTIVE || isTransporter(psDroid)); } /* returns true if it's a VTOL weapon droid which has completed all runs */ diff --git a/src/quickjs_backend.cpp b/src/quickjs_backend.cpp index d337cf8cb1e..1550980cb30 100644 --- a/src/quickjs_backend.cpp +++ b/src/quickjs_backend.cpp @@ -788,7 +788,7 @@ JSValue convResearch(const RESEARCH *psResearch, JSContext *ctx, int player) //;; * ```status``` The completeness status of the structure. It will be one of ```BEING_BUILT``` and ```BUILT```. //;; * ```type``` The type will always be ```STRUCTURE```. //;; * ```cost``` What it would cost to build this structure. (3.2+ only) -//;; * ```direction``` The direction the structure is facing. (4.4+ only) +//;; * ```direction``` The direction the structure is facing. (4.5+ only) //;; * ```stattype``` The stattype defines the type of structure. It will be one of ```HQ```, ```FACTORY```, ```POWER_GEN```, //;; ```RESOURCE_EXTRACTOR```, ```LASSAT```, ```DEFENSE```, ```WALL```, ```RESEARCH_LAB```, ```REPAIR_FACILITY```, //;; ```CYBORG_FACTORY```, ```VTOL_FACTORY```, ```REARM_PAD```, ```SAT_UPLINK```, ```GATE``` and ```COMMAND_CONTROL```. @@ -939,7 +939,6 @@ JSValue convFeature(const FEATURE *psFeature, JSContext *ctx) //;; * ```experience``` Amount of experience this droid has, based on damage it has dealt to enemies. //;; * ```cost``` What it would cost to build the droid. (3.2+ only) //;; * ```isVTOL``` True if the droid is VTOL. (3.2+ only) -//;; * ```isFlying``` True if the droid is currently flying. (4.4+ only) //;; * ```canHitAir``` True if the droid has anti-air capabilities. (3.2+ only) //;; * ```canHitGround``` True if the droid has anti-ground capabilities. (3.2+ only) //;; * ```isSensor``` True if the droid has sensor ability. (3.2+ only) @@ -1015,7 +1014,6 @@ JSValue convDroid(const DROID *psDroid, JSContext *ctx) QuickJS_DefinePropertyValue(ctx, value, "canHitAir", JS_NewBool(ctx, aa), JS_PROP_ENUMERABLE); QuickJS_DefinePropertyValue(ctx, value, "canHitGround", JS_NewBool(ctx, ga), JS_PROP_ENUMERABLE); QuickJS_DefinePropertyValue(ctx, value, "isVTOL", JS_NewBool(ctx, isVtolDroid(psDroid)), JS_PROP_ENUMERABLE); - QuickJS_DefinePropertyValue(ctx, value, "isFlying", JS_NewBool(ctx, isFlying(psDroid)), JS_PROP_ENUMERABLE); QuickJS_DefinePropertyValue(ctx, value, "droidType", JS_NewInt32(ctx, (int)type), JS_PROP_ENUMERABLE); QuickJS_DefinePropertyValue(ctx, value, "experience", JS_NewFloat64(ctx, (double)psDroid->experience / 65536.0), JS_PROP_ENUMERABLE); QuickJS_DefinePropertyValue(ctx, value, "health", JS_NewFloat64(ctx, 100.0 / (double)psDroid->originalBody * (double)psDroid->body), JS_PROP_ENUMERABLE);