
M67 Frag Grenade does not explode in hand
MCT32 opened this issue ยท 2 comments
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
- Select M67 Frag Grenade
- Right click to start fuse
- Wait until fuse runs out
- 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
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
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.