-
-
Notifications
You must be signed in to change notification settings - Fork 28
fix(crash): simplify attack handling logic #887
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
base: main
Are you sure you want to change the base?
Conversation
andrewgazelka
commented
Apr 26, 2025
- Extract reusable functions for immunity checks and combat stats calculations
- Add operator overloading via Add/Sub traits for Position and CombatStats
- Reduce nesting depth in attack handling code
- Update several dependencies including arboard and rand
- Add 'add' and 'add_assign' features to derive_more dependency
- Extract reusable functions for immunity checks and combat stats calculations - Add operator overloading via Add/Sub traits for Position and CombatStats - Reduce nesting depth in attack handling code - Update several dependencies including arboard and rand - Add 'add' and 'add_assign' features to derive_more dependency
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.
Pull Request Overview
This PR refactors the attack handling logic to simplify code paths and improve reusability while adding operator overloading for Position and CombatStats.
- Extracts reusable functions for immunity checks and combat stats calculations.
- Adds Add/Sub traits derivations for Position and updates derive_more dependency settings.
- Reduces nesting depth in attack handling code and updates several dependencies.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
crates/hyperion/src/simulation/mod.rs | Updated derives for Position to include operator overloads (Add/Sub). |
Cargo.toml | Updated derive_more features by adding add and add_assign options. |
Files not reviewed (1)
- justfile: Language not supported
Comments suppressed due to low confidence (1)
crates/hyperion/src/simulation/mod.rs:392
- The Cargo.toml update enables the 'add_assign' feature but the Position struct does not derive AddAssign. Consider deriving AddAssign for Position if assignment addition operations are intended.
PartialEq, Add, Sub
Benchmark Results for general
Comparing to 4c402d0 |
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #887 +/- ##
==========================================
+ Coverage 20.85% 21.11% +0.26%
==========================================
Files 161 161
Lines 16867 16658 -209
Branches 468 468
==========================================
Hits 3518 3518
+ Misses 13285 13076 -209
Partials 64 64
🚀 New features to boost your workflow:
|
Benchmark Results for general
Comparing to 4c402d0 |
Benchmark Results for general
Comparing to 4c402d0 |
Co-authored-by: TestingPlant <[email protected]>
Benchmark Results for general
Comparing to 4c402d0 |