-
Notifications
You must be signed in to change notification settings - Fork 117
bugfix(weapon): Fix unreliability of historic bonus weapons #1727
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
Conversation
…eet the bonus count requirement
xezon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New modified implementation looks much better. 👍
xezon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me.
If I am not mistaken Historic Weapon is also missing xfer. I have tracked it here: #1754
…Hackers#1727) This change fixes historic bonus weapons not triggering reliably. The issue is that whenever a historic bonus weapon is triggered (e.g. a firestorm) it resets the historic bonus count for all weapons using the same template. This means that if a firestorm is triggered while another firestorm is half way to triggering, that other firestorm's progress will be reset. In addition, historic damage instances now more accurately expire based on the weapon template's HistoricBonusTime rather than the global HistoricDamageLimit. Historic damage involved in triggering a historic weapon cannot be used in subsequent attempts.
This change fixes historic bonus weapons not triggering reliably. The issue is that whenever a historic bonus weapon is triggered (e.g. a firestorm) it resets the historic bonus count for all weapons using the same template. This means that if a firestorm is triggered while another firestorm is half way to triggering, that other firestorm's progress will be reset.
In addition, historic damage instances now more accurately expire based on the weapon template's
HistoricBonusTimerather than the globalHistoricDamageLimit. Historic damage involved in triggering a historic weapon cannot be used in subsequent attempts.Example
Four MiGs must strike a target within a certain radius to trigger a firestorm. Each missile contributes +1 to the historic bonus count of
NapalmMissileWeapon, which must reach 8 to create the firestorm.Now imagine a scenario where there are two squadrons of four MiGs each, Squad A and Squad B. Both squads strike different targets at the roughly same time.
Squad A MiG 1 increases the historic bonus count to 2.
Squad A MiG 2 increases the historic bonus count to 4.
Squad B MiG 1 increases the historic bonus count to 6.
Squad B MiG 2 increases the historic bonus count to 8.
Squad A MiG 3 increases the historic bonus count to 10.
Squad A MiG 4 increases the historic bonus count to 12.
Of the 12 historic bonus instances, 8 are determined to be in the same location, and thus a firestorm is triggered for Squad A.
The triggering of Squad A's firestorm resets the historic bonus count to 0.
Squad B MiG 3 increases the historic bonus count to 2.
Squad B MiG 4 increases the historic bonus count to 4.
No firestorm is triggered for Squad B.
Demonstration of the bug
BAD_FIRESTORM.mp4
Note: When testing with Inferno Cannons, it is preferable to test without the
HeightDieUpdatemodules in theInfernoTankShellandInfernoTankShellUpgradedweapon objects for 100% accuracy. See #1564 from the patch repository for more info.