Code: Select all
class TestPistol : Pistol
{
override state GetUpState()
{
if (owner)
{
owner.A_PlaySound("misc/w_pkup", CHAN_WEAPON);
}
return Super.GetUpState();
}
}
Code: Select all
gzdoom.exe -file zscript.txt -warp 1 +give testpistol
However, when going to another map, this will not work as expected. Instead, one of the two things will happen depending on GZDoom version:
1) GZDoom 3.6.0 crashes with a very fatal error.
2) GZDoom g3.7pre-4-gcc8112f88 doesn't crash, but the sound is still not heard.
Expected behavior: the sound should be heard regardless of the context GetUpState is called in.
It is interesting to note that if TestPistol is assigned as a starting weapon, there is no crash (as well as no sound) when starting a map.