Skip to content

Conversation

@TtroubleTT
Copy link

@TtroubleTT TtroubleTT commented Jan 30, 2025

Description

Describe the changes

  • Added a check to try get value from the dictionary instead of accessing it for how much ammo is in player inventory.

What is the current behavior? (You can also link to an open issue here)

  • Accesses the dictionary directly which could cause an error since this event runs after the ammo is loaded into the gun.

What is the new behavior? (if this is a feature change)

  • Uses a try get value to get the ammo if it cant find it defaults to 0.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No

Other information:
N/A


Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

@TtroubleTT TtroubleTT changed the title Potential Error Fix With Custom Weapon Reloading fix: Potential Error Fix With Custom Weapon Reloading Jan 30, 2025
Co-authored-by: Yamato <66829532+louis1706@users.noreply.github.com>
@louis1706 louis1706 merged commit 936b864 into ExMod-Team:dev Feb 2, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants