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

Add ANTITORPEDO category to all units with antitorp weapons #6001

Merged
merged 6 commits into from Mar 20, 2024

Conversation

lL1l1
Copy link
Contributor

@lL1l1 lL1l1 commented Mar 18, 2024

Description of the proposed changes

Adds ANTITORPEDO to units with antitorpedo weapons. Cherry picks #5990 #5991 #5992 to consolidate into one PR.
The regex string used to find antitorp weapons was: ProjectileId ?= ?.*Antitorpedo.

Testing done on the proposed changes

I didn't find any mentions of the ANTITORPEDO unit categories in the repository (only mentioned for projectile categories), M28AI, M27AI, RNGAI, or AI-Uveso. The category changes should just improve the consistent application of the category, making it useful for AI developers. For example, M28UnitInfo.lua uses

if oCurWeapon.RangeCategory == 'UWRC_Countermeasure' then
  --Target restriction should catch all cases, have but the most common labels as redundancy as well (doesnt cover mega? and fatboy? torpedo defence which have antitorpedoleft, left1, left2, right, etc. labels)
  if oCurWeapon.TargetRestrictOnlyAllow == "TORPEDO" or oCurWeapon.Label == 'AntiTorpedo' or oCurWeapon.Label == 'AntiTorpedo01' or oCurWeapon.Label == 'AntiTorpedoF' then
    oUnit[refbHasTorpedoDefence] = true
  else

which can be simplified and improved thanks to theses category changes. @maudlin27

Checklist

  • Changes are annotated, including comments where useful

The category is already annotated in categories.lua.

  • Changes are documented in the changelog for the next game version

Copy link
Member

@Garanas Garanas left a comment

Choose a reason for hiding this comment

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

This looks great 👍 , I don't think Maudlin can fully drop his check* because mods may be as or more inconsistent as we were up until now

@lL1l1 lL1l1 merged commit 2e38df9 into FAForever:deploy/fafdevelop Mar 20, 2024
@lL1l1 lL1l1 deleted the Fix/ANTITORPEDO-category branch April 1, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: unit categories related to unit categories defined in the blueprint files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants