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 retaliation raids and shelling #3511

Merged
merged 3 commits into from
Nov 1, 2024
Merged

Fix retaliation raids and shelling #3511

merged 3 commits into from
Nov 1, 2024

Conversation

mszabo-wikia
Copy link
Contributor

@mszabo-wikia mszabo-wikia commented Oct 27, 2024

Changes

As reported in #3419, retaliation raids currently cause infinite error spam if the bombardment that triggered the retaliation was from a temporary map that was disposed of by the time the raid was actually executed. Fix it by checking whether the target map for the raid is actually valid.

While testing this, I found that retaliation shelling has also been broken since d90f3e1. Fix it by accounting for the case where the launcher is not spawned at all, since retaliation bombardment shells are "launched" by world pawns.
Also ensure bombardments from other factions' settlements do not trigger a retaliation
bombardment if the target faction isn't hostile to the owner of the tile,
and introduce a configurable retaliation fire delay that scales with how damaged a
site is.

References

Testing

Check tests you have performed:

  • Compiles without warnings
  • Game runs without errors
  • Playtested a colony -- triggered retaliation from an event tile, then verified shell behavior and that no errors occur if you leave the map before the raid arrives (as well as that the raid does arrive if you hang around)

As reported in #3419, retaliation raids currently cause infinite error spam
if the bombardment that triggered the retaliation was from a temporary map
that was disposed of by the time the raid was actually executed. Fix it by
checking whether the target map for the raid is actually valid.

While testing this, I found that retaliation shelling has also been broken since d90f3e1.
Fix it by accounting for the case where the launcher is not spawned at all,
since retaliation bombardment shells are "launched" by world pawns.
@mszabo-wikia mszabo-wikia requested review from a team as code owners October 27, 2024 15:58
Copy link

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

@github-actions github-actions bot added the Download in Comments This PR has a zipfile download available. label Oct 27, 2024
@mszabo-wikia
Copy link
Contributor Author

Here's a test save with everything setup and a retaliation raid + shells already incoming: temp_map_bomb.rws.zip

N7Huntsman
N7Huntsman previously approved these changes Oct 28, 2024
Copy link
Contributor

@N7Huntsman N7Huntsman left a comment

Choose a reason for hiding this comment

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

No longer throws errors when shelling a caravan map that no longer exists.

As reported in #3419, retaliation raids currently cause infinite error spam
if the bombardment that triggered the retaliation was from a temporary map
that was disposed of by the time the raid was actually executed. Fix it by
checking whether the target map for the raid is actually valid.

While testing this, I found that retaliation shelling has also been broken since d90f3e1.
Fix it by accounting for the case where the launcher is not spawned at all,
since retaliation bombardment shells are "launched" by world pawns.
Also ensure bombardments from other factions' settlements do not trigger a retaliation
bombardment if the target faction isn't hostile to the owner of the tile,
and introduce a configurable retaliation fire delay that scales with how damaged a
site is.
Copy link

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

Copy link
Contributor

@MaxDorob MaxDorob left a comment

Choose a reason for hiding this comment

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

Looks good

Copy link

github-actions bot commented Nov 1, 2024

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

Copy link
Contributor

@N7Huntsman N7Huntsman left a comment

Choose a reason for hiding this comment

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

Bug is fixed, and new shelling behavior is working as intended. We may want to amend the retaliatory raid message to make it clear what map the raid is targeting, but that doesn't need to hold up this PR.

@N7Huntsman N7Huntsman merged commit 57d6c77 into Development Nov 1, 2024
3 checks passed
@N7Huntsman N7Huntsman deleted the fix-retaliation branch November 1, 2024 07:53
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
3 participants