Skip to content

Commit

Permalink
Merge branch 'master' into feat/tinkering-princess-ai
Browse files Browse the repository at this point in the history
  • Loading branch information
Scoppio authored Jan 26, 2025
2 parents c25a369 + 4599a35 commit d138802
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions megamek/docs/history.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ MEGAMEK VERSION HISTORY:
+ Fix #1072: Can bomb and strafe the ground even if no LOS
+ PR #6442: Unit Tests for WeaponAttackAction to help test megamek
+ Fix #6434: pilot rolls reported before all attacks (also #3890)
+ PR #6443: Fix for ranked path entries being overwritten

0.50.02 (2024-12-30 2130 UTC)
+ PR #6183: New GM Commands, princess commands on map menu, graphics for some explosions
Expand Down
5 changes: 4 additions & 1 deletion megamek/src/megamek/client/bot/princess/RankedPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ public boolean equals(Object object) {
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
.append(getPath()).append(getRank()).append(getReason()).append(getExpectedDamage())
.append(getPath())
.append(getRank())
.append(getReason())
.append(getExpectedDamage())
.toHashCode();
}

Expand Down
18 changes: 16 additions & 2 deletions megamek/src/megamek/common/MovePath.java
Original file line number Diff line number Diff line change
Expand Up @@ -2125,11 +2125,25 @@ public boolean equals(Object object) {

if (!(object instanceof MovePath movePath)) return false;

return new EqualsBuilder().append(isCareful(), movePath.isCareful()).append(gravityConcern, movePath.gravityConcern).append(gravity, movePath.gravity).append(getCoordsSet(), movePath.getCoordsSet()).append(getSteps(), movePath.getSteps()).append(containedStepTypes, movePath.containedStepTypes).append(getWaypoint(), movePath.getWaypoint()).isEquals();
return new EqualsBuilder()
.append(entity, movePath.entity)
.append(careful, movePath.careful)
.append(gravityConcern, movePath.gravityConcern)
.append(gravity, movePath.gravity)
.append(steps, movePath.steps)
.append(containedStepTypes, movePath.containedStepTypes)
.isEquals();
}

@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(getCoordsSet()).append(getSteps()).append(containedStepTypes).append(isCareful()).append(gravityConcern).append(gravity).append(getWaypoint()).toHashCode();
return new HashCodeBuilder(17, 37)
.append(entity)
.append(steps)
.append(containedStepTypes)
.append(careful)
.append(gravityConcern)
.append(gravity)
.toHashCode();
}
}

0 comments on commit d138802

Please sign in to comment.