Skip to content

Fix Apparel_Shield Bugs#4611

Open
ViralReaction wants to merge 6 commits into
Developmentfrom
Fix-Shield-Armor-Protection
Open

Fix Apparel_Shield Bugs#4611
ViralReaction wants to merge 6 commits into
Developmentfrom
Fix-Shield-Armor-Protection

Conversation

@ViralReaction

@ViralReaction ViralReaction commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Changes

Describe adjustments to existing features made in this merge, e.g.

  • Compare apparel to shield to prevent it from adding to armor values.
  • Checking dinfo.Tool is a cheap way to see if it is a melee attack. This prevents PawnKind natural tools and ranged weapon's melee tools from having to get through both the Melee block and than armor penetration on shield after a missed block
  • Refactor LINQ statement to a for loop
  • Fixes shield armor being applied twice to inventory UI tab
  • Fixes recursive blunt damage calculating against shield coverage again

Reasoning

Why did you choose to implement things this way, e.g.

  • The body part we use to attach shield to pawn was being double dipped for protection. Once during shield coverage calculation and than again if that is the part to be shot during apparel penetration. Logically each piece of apparel should only get one shot at preventing penetration and damage.
  • Apparel should never be null, but comparing it to Shield is a clean way to prevent the shield from being used in apparel penetration calculations
  • Defaulting to true on null weapon prevents the recursive blunt damage from checking against shield armor all over again. (If intended can reverse)

Side Effects

  • Melee combat will be more deadly as melee attacks are not being double penalized by both the block system and than again on penetration. Melee combat has always been complained by users, particularly medieval combat, bionic weapons and fighting animals being rather lack luster.

Alternatives

Describe alternative implementations you have considered, e.g.

  • Double armor
  • Add back extra null check
  • Extra allocations and cycles from doing work on a List

Testing

Check tests you have performed:

  • Compiles without warnings
  • Game runs without errors
  • (For compatibility patches) ...with and without patched mod loaded
  • Playtested a colony (specify how long)

@ViralReaction ViralReaction requested review from a team as code owners June 7, 2026 22:34
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27106867438.zip

@github-actions github-actions Bot added the Download in Comments This PR has a zipfile download available. label Jun 7, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27106920531.zip

@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27107058858.zip

@ViralReaction ViralReaction marked this pull request as draft June 7, 2026 22:48
@ViralReaction ViralReaction marked this pull request as ready for review June 7, 2026 22:59
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27109001170.zip

@ViralReaction ViralReaction changed the title Fix Shield Double Armor Fix Shield Bugs Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27109984668.zip

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

You can download the rebuilt assembly for this PR here: https://combatextended.lp-programming.com/CombatExtended-27110170191.zip

@ViralReaction ViralReaction changed the title Fix Shield Bugs Fix Apparel_Shield Bugs Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Download in Comments This PR has a zipfile download available.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant