Skip to content

Conversation

@ranisalt
Copy link
Member

@ranisalt ranisalt commented Dec 3, 2025

Pull Request Prelude

Changes Proposed

Drops an unneeded check in WeaponDistance::useWeapon, if bow->getHitChance() is 0 it doesn't matter if it's added to chance or not.

@ranisalt ranisalt requested a review from Copilot December 3, 2025 21:19
Copilot finished reviewing on behalf of ranisalt December 3, 2025 21:21
Copy link

Copilot AI left a 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 pull request refactors a conditional check in the WeaponDistance::useWeapon method by removing an unnecessary comparison. The change simplifies the code by eliminating the check for bow->getHitChance() != 0, since adding 0 to the chance variable has no effect on the calculation. The refactoring also modernizes the code by using a C++ if-initializer pattern.

  • Removes redundant zero-value check for bow->getHitChance()
  • Refactors to use if-initializer for more concise pointer null checking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@ramon-bernardo ramon-bernardo left a comment

Choose a reason for hiding this comment

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

LGTM 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants