mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-02-21 19:00:56 +00:00
- Fixed: Destroying a weapon that claimed it was its own sister would crash.
SVN r3441 (trunk)
This commit is contained in:
parent
f500947814
commit
5f23b4f64a
1 changed files with 8 additions and 3 deletions
|
@ -146,11 +146,16 @@ bool AWeapon::Use (bool pickup)
|
||||||
|
|
||||||
void AWeapon::Destroy()
|
void AWeapon::Destroy()
|
||||||
{
|
{
|
||||||
if (SisterWeapon != NULL)
|
AWeapon *sister = SisterWeapon;
|
||||||
|
|
||||||
|
if (sister != NULL)
|
||||||
{
|
{
|
||||||
// avoid recursion
|
// avoid recursion
|
||||||
SisterWeapon->SisterWeapon = NULL;
|
sister->SisterWeapon = NULL;
|
||||||
SisterWeapon->Destroy();
|
if (sister != this)
|
||||||
|
{ // In case we are our own sister, don't crash.
|
||||||
|
sister->Destroy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Super::Destroy();
|
Super::Destroy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue