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

multiple fixes related to counter-battery fire #3011

Merged
merged 4 commits into from
Jul 17, 2021

Conversation

NickAragua
Copy link
Member

@NickAragua NickAragua commented Jul 14, 2021

These prevent several game-blocking and non-game-blocking NPEs which occur when handling counter-battery fire against a unit that was previously destroyed.

Fixes mekhq #2733

@HammerGS
Copy link
Member

This supposed to point to MekHQ 2733?

@NickAragua
Copy link
Member Author

Yes

Copy link
Contributor

@Windchild292 Windchild292 left a comment

Choose a reason for hiding this comment

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

Mostly looks good, just a few comments first

* Utility function used to safely tell whether two Targetables are in the same hex.
* Does not throw exceptions in case of nulls.
*/
public static boolean atSamePosition(Targetable first, Targetable second) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nullable annotate both first and second

Copy link
Contributor

Choose a reason for hiding this comment

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

Further, for the name... isAtSamePosition would probably be a better name than atSamePosition.

megamek/src/megamek/server/Server.java Show resolved Hide resolved
NickAragua and others added 2 commits July 14, 2021 00:02
…Handler.java

Co-authored-by: Justin Bowen <39067288+Windchild292@users.noreply.github.com>
@NickAragua NickAragua merged commit 0387144 into MegaMek:master Jul 17, 2021
@NickAragua NickAragua deleted the figher_squadron_rework branch July 17, 2021 01:34
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.

3 participants