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

Handle trigger attachments that still use deprecated isSuicide #6970

Merged

Conversation

trevan
Copy link
Contributor

@trevan trevan commented Jun 30, 2020

This adds getIsSuicide back so that the trigger attachments in TWW will still work.

I've also wrapped the exception inside a new exception that has the name of the trigger, the property, and what type of attachment it is on. This should help in finding and fixing similar issues.

Fixes #6961

Functional Changes

[] New map or map update
[] New Feature
[] Feature update or enhancement
[] Feature Removal
[] Code Cleanup or refactor
[] Configuration Change
[x] Problem fix
[] Other:

Testing

Loaded a TWW save that triggered it, verified that the unit attachment had suicide turned off before non-combat and then had it turned back on after non-combat. And then I let the UI play for several more rounds to see if anything else might happen.

Screens Shots

Additional Notes to Reviewer

Release Note

FIX|TWW will no longer crash before Germany's non-combat phase.

try {
isValueTheSame = newValue.equals(propertyAttachment.getRawPropertyString(propertyName));
} catch (final UnsupportedOperationException e) {
throw new UnsupportedOperationException(
Copy link
Member

Choose a reason for hiding this comment

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

The extra debug information here is excellent - much better error handling 👍

@DanVanAtta DanVanAtta merged commit eb93f8f into triplea-game:master Jul 1, 2020
@trevan trevan deleted the trigger-attachments-missing-options branch July 2, 2020 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TriggerAttachments on removed options cause an exception
3 participants