Cubed-Development / Modern-Warfare-Cubed

Welcome to the official GitHub Repository for Modern Warfare Cubed!
Apache License 2.0
92 stars 60 forks source link

M67 Frag Grenade does not explode in hand #306

Closed MCT32 closed 9 months ago

MCT32 commented 10 months ago

Describe the bug

When cooking an M67 Frag Grenade, it does not explode in the player's hand once the fuse has run out, instead throwing the error in the logs below.

Reproducibility

Please try to reproduce the issue with as few other mods as possible. Then check one of the following checkboxes according to your results. To check a checkbox, replace the space between the square brackets with an x (like this [x]) or create the issue and check the checkbox by clicking on it.

To Reproduce

  1. Select M67 Frag Grenade
  2. Right click to start fuse
  3. Wait until fuse runs out
  4. See error in console

Expected behavior

Grenade explodes in player's hand.

Screenshots or/and videos

https://github.com/Cubed-Development/Modern-Warfare-Cubed/assets/32090502/94de637e-0eaa-4d98-9095-2a9f2520a70a

Logs or/and crash reports

https://mclo.gs/IxSpJF9

Versions

Specification:

MCT32 commented 10 months ago

After looking through the code, it seems like serverThrowGrenade() in GrenadeAttackAspect passes null as the entity to createServerSideExplosion() when it relies on it for the position, ignoring the position passed as an argument. I'm going to make a fork and try passing the player as the entity so that the position can be used. If it works, I'll submit a pull request. Perhaps the position arguments should be removed from createServerSideExplosion() if they are not used.

SticksDeveloper commented 9 months ago

I like it this way as you haven't started the fuse by pulling of it, you just put the pin back

in short if it's not short enough: it's realistic as it doesn't explode without pulling the latch/fuse