Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CHL_Event_Compiletest (handle parameters of type 'Object') #1257

Merged
merged 2 commits into from
Sep 17, 2023

Conversation

remcoros
Copy link
Contributor

Now handles events with parameters of type 'Object' properly.

One (and the only) example is AllowOnCovertActionComplete:

...\X2WOTCCommunityHighlander2\X2WOTCCommunityHighlander\Src\X2WOTCCommunityHighlander\Classes\CHL_Event_Compiletest.uc(55) : Error, Cast from 'Object' to 'Object' is unnecessary

When an event has parameters of type 'Object' this resulted in an cast from Object to Object, which is invalid in uc. This skips the cast if the parameter is of type 'Object'
@Iridar Iridar requested a review from robojumper August 30, 2023 17:37
@remcoros remcoros changed the title Fixes/chl event compiletest Fix CHL_Event_Compiletest (handle parameters of type 'Object') Aug 30, 2023
@github-actions
Copy link
Contributor

Pull request modifies event listener templates

Difference (click to expand)
diff --git a/target/CHL_Event_Compiletest.uc b/target/CHL_Event_Compiletest.uc
index 1c1fe88..49e8a80 100644
--- a/target/CHL_Event_Compiletest.uc
+++ b/target/CHL_Event_Compiletest.uc
@@ -52,11 +52,11 @@ static function EventListenerReturn OnAllowOnCovertActionCompleteAnalytics(Objec
 	Tuple = XComLWTuple(EventData);
 
 	bAllow = Tuple.Data[0].b;
-	OriginalEventData = Object(Tuple.Data[1].o);
-	OriginalEventSource = Object(Tuple.Data[2].o);
+	OriginalEventData = Tuple.Data[1].o;
+	OriginalEventSource = Tuple.Data[2].o;
 	OriginalGameState = XComGameState(Tuple.Data[3].o);
 	OriginalEvent = Tuple.Data[4].n;
-	OriginalCallbackData = Object(Tuple.Data[5].o);
+	OriginalCallbackData = Tuple.Data[5].o;
 
 	// Your code here
 
What? (click to expand)

The Highlander documentation tool generates event listener examples from event specifications.
This comment contains the modifications that would be made to the copy-pasteable event listeners in documentation, for PR authors and reviewers to inspect for correctness, and will automatically be kept up-to-date whenever this PR is updated.

@Iridar Iridar added the ready-to-review A pull request is ready to be reviewed label Sep 17, 2023
@Iridar Iridar added ready-for-merge the pull request was reviewed and is ready to be merged. and removed ready-to-review A pull request is ready to be reviewed labels Sep 17, 2023
@Iridar
Copy link
Contributor

Iridar commented Sep 17, 2023

LGTM (c) robojumper on discord.

@Iridar Iridar merged commit d4a4c32 into X2CommunityCore:master Sep 17, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge the pull request was reviewed and is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants