Modern Warfare Cubed

Modern Warfare Cubed

557k Downloads

M67 Frag Grenade does not explode in hand

MCT32 opened this issue ยท 2 comments

commented

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.

  • I reproduced this issue with as few other mods as possible installed.
  • I am unable to reproduce this issue consistently.

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

2023-11-20.19-59-03.mp4

Logs or/and crash reports

https://mclo.gs/IxSpJF9

Versions

  • Modern Warfare Cubed: MWC-0.1-Dev-14
  • Forge: 1.12.2 - 14.23.5.2859
  • Java: JDK 8 - 392-392
  • Java JVM: Unknown

Specification:

  • OS: Windows 10
  • CPU: AMD Ryzen 5 3400G
  • GPU: NVIDIA GeForce RTX 3050
  • RAM Allocated: 16GB
commented

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.

commented

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