Skip to content

Commit

Permalink
simplify HasMissilesDefense code
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Dec 6, 2020
1 parent 4044104 commit cc6dac6
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions defence.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ func (d DefensesInfos) HasShipDefense() bool {

// HasMissilesDefense returns either or not AntiBallisticMissiles are present
func (d DefensesInfos) HasMissilesDefense() bool {
if d.ByID(AntiBallisticMissiles.GetID()) > 0 {
return true
}
return false
return d.AntiBallisticMissiles > 0
}

// CountShipDefenses returns the count of defenses which can attack ships i.e., excluding AntiBallisticMissiles
Expand Down

0 comments on commit cc6dac6

Please sign in to comment.