player_t::GetPSprite crashes if ReadyWeapon is null
Posted: Sun Jan 26, 2020 5:23 pm
Exactly what it says in the thread title. Someone on the ZDoom Discord (Jekyll Grim Payne) was having issues with this. Taking the ReadyWeapon away and setting ReadyWeapon to null was making his mod crash.
This is caused by the "newcaller" pointer in GetPSprite being set to null, which it seems to not like. (Specifically, one of the weapons in the mod was calling SetPSprite from DoEffect even when not selected)
No idea what would be the best course of action here. To me, it seems like this may have to cause a VM abort. I hope I'm wrong and it can be made to work with a null ReadyWeapon, though, as the ReadyWeapon isn't even the only thing that can create PSprites now anyways.
Steps to reproduce:
This is caused by the "newcaller" pointer in GetPSprite being set to null, which it seems to not like. (Specifically, one of the weapons in the mod was calling SetPSprite from DoEffect even when not selected)
No idea what would be the best course of action here. To me, it seems like this may have to cause a VM abort. I hope I'm wrong and it can be made to work with a null ReadyWeapon, though, as the ReadyWeapon isn't even the only thing that can create PSprites now anyways.
Steps to reproduce:
- Start a new game with the attached example PK3.
- Give yourself "Test" in the console.