Skip to content

Commit ff08624

Browse files
committed
Document IsClassNative with tracking issue
1 parent a32a61c commit ff08624

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

.scripts/make_docs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def make_doc_item(lines: List[str], file: str,
112112
elif k == 'issue':
113113
item[k] = int(v)
114114
elif k == 'tags':
115-
item[k] = v.split(',')
115+
tags = v.split(',')
116+
item[k] = tags if tags != [''] else []
116117
else:
117118
print("%s: error: %s: unknown key `%s`" % (sys.argv[0], file, k))
118119

@@ -301,7 +302,8 @@ def render_docs(doc_items: List[dict], outdir: str):
301302
file.write("<h1>%s</h1>\n\n" % (item["feature"]))
302303
file.write("Tracking Issue: [#%i](%s)\n\n" %
303304
(item["issue"], HL_ISSUES_URL % (item["issue"])))
304-
file.write("Tags: " + ", ".join(item["tags"]) + "\n\n")
305+
if len(item["tags"]) > 0:
306+
file.write("Tags: " + ", ".join(item["tags"]) + "\n\n")
305307
file.write("\n".join([t["text"] for t in item["texts"]]))
306308
file.write("\n\n")
307309
file.write("## Source code references\n\n")

X2WOTCCommunityHighlander/Src/Core/Classes/Object.uc

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,15 +2401,21 @@ native final function bool IsPointInBox( const out Vector Point, const out Box T
24012401

24022402
native final function bool LineBoxIntersection(Box BBox, Vector Start, Vector End, Vector Direction, Vector OneOverDirection, out Vector HitLocation);
24032403

2404-
// Issue #XYZ Start
2405-
// Must be called on a `Class` instance, i.e. if you have an X2AbilityTargetStyle and
2406-
// want to know whether it's native, check `TargetStyle.class.IsNative()`
2407-
final function bool IsNative()
2404+
// Issue #767 Start
2405+
/// HL-Docs: feature:IsClassNative; issue:767; tags:
2406+
/// To check whether a given class is native, use the static function
2407+
/// `IsClassNative`. Example usage:
2408+
///
2409+
/// ```unrealscript
2410+
/// IsClassNative(class'X2AbilityTarget_Single'); // True
2411+
/// IsClassNative(UnitState.GetVisualizer().Class); // False because XGUnit is always non-native
2412+
/// ```
2413+
final function bool IsClassNative(Class Klass)
24082414
{
24092415
// This is the flag the UC VM uses to mark a class as native
2410-
return (self.ObjectFlags.B & (1 << 26)) != 0;
2416+
return (Klass.ObjectFlags.B & (1 << 26)) != 0;
24112417
}
2412-
// Issue #XYZ END
2418+
// Issue #767 END
24132419

24142420

24152421
defaultproperties

0 commit comments

Comments
 (0)