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

Add more RevealDisguiseOn types and unhardcode some events #13639

Merged
merged 2 commits into from Sep 13, 2017

Conversation

abcdefg30
Copy link
Member

Events means things like Infiltration, Demolition and Unloading. That was hardcoded to only uncloak units before, but now calls an interface which can be easily implemented by custom traits.

Copy link
Contributor

@GraionDilach GraionDilach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The interfaces seem nice and I guess they will find more uses longterm even.

👍

Copy link
Member

@Mailaender Mailaender left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good otherwise.

if (cloak != null && cloak.Info.UncloakOn.HasFlag(UncloakType.Infiltrate))
cloak.Uncloak();
foreach (var ini in notifiers)
ini.Infiltrating(self);

foreach (var t in target.TraitsImplementing<INotifyInfiltrated>())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is already a very similar interface so I suggest to either use that one or move the Infiltrating check before OnInside is triggered.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using the traits of the target, while we want the traits of self. Moving could work, but are you sure that we don't regress anything else then? (The uncloaking also happened after checking if the infiltration is valid.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see.

@abcdefg30
Copy link
Member Author

Rebased.

if (cloak != null && cloak.Info.UncloakOn.HasFlag(UncloakType.Infiltrate))
cloak.Uncloak();
foreach (var ini in notifiers)
ini.Infiltrating(self);

foreach (var t in target.TraitsImplementing<INotifyInfiltrated>())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see.

@reaperrr reaperrr merged commit 17f7aac into OpenRA:bleed Sep 13, 2017
@reaperrr
Copy link
Contributor

changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants