Fix a potential crash when selling weapons.

This commit is contained in:
Mari the Deer 2022-08-11 16:24:23 +02:00
commit 02373b99f0
2 changed files with 3 additions and 3 deletions

View file

@ -389,7 +389,7 @@ extend Class SWWMHandler
if ( item is 'SWWMWeapon' )
{
let c = Weapon(players[e.Args[0]].mo.FindInventory(item));
if ( c.SisterWeapon && (players[e.Args[0]].ReadyWeapon == c.SisterWeapon) )
if ( c && c.SisterWeapon && (players[e.Args[0]].ReadyWeapon == c.SisterWeapon) )
{
players[e.Args[0]].ReadyWeapon = c;
players[e.Args[0]].SetPSprite(PSP_WEAPON,c.FindState("Ready"));