Skip to content

Commit 3582f03

Browse files
committed
Document IsClassNative with tracking issue
1 parent 9128e4d commit 3582f03

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
@@ -107,7 +107,8 @@ def make_doc_item(lines: List[str], file: str,
107107
elif k == 'issue':
108108
item[k] = int(v)
109109
elif k == 'tags':
110-
item[k] = v.split(',')
110+
tags = v.split(',')
111+
item[k] = tags if tags != [''] else []
111112
else:
112113
print("%s: error: %s: unknown key `%s`" % (sys.argv[0], file, k))
113114

@@ -227,7 +228,8 @@ def render_docs(doc_items: List[dict], outdir: str):
227228
file.write("# %s\n\n" % (item["feature"]))
228229
file.write("Tracking Issue: [#%i](%s)\n\n" %
229230
(item["issue"], HL_ISSUES_URL % (item["issue"])))
230-
file.write("Tags: " + ", ".join(item["tags"]) + "\n\n")
231+
if len(item["tags"]) > 0:
232+
file.write("Tags: " + ", ".join(item["tags"]) + "\n\n")
231233
file.write(item["text"])
232234
file.write("\n\n")
233235
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)