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 5796: Safety check for entities with no hex location, e.g. just-loaded infantry #5814

Merged
merged 2 commits into from
Jul 28, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -10046,6 +10046,9 @@ public boolean isEligibleForPhysical() {
&& hasWorkingMisc(MiscType.F_TOOLS,
MiscType.S_DEMOLITION_CHARGE)) {
Hex hex = game.getBoard().getHex(getPosition());
if (hex == null) {
Sleet01 marked this conversation as resolved.
Show resolved Hide resolved
return false;
}
return hex.containsTerrain(Terrains.BUILDING);
}
// only mechs and protos have physical attacks (except tank charges)
Expand Down