mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +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()
|
||||
{
|
||||
if (SisterWeapon != NULL)
|
||||
AWeapon *sister = SisterWeapon;
|
||||
|
||||
if (sister != NULL)
|
||||
{
|
||||
// avoid recursion
|
||||
SisterWeapon->SisterWeapon = NULL;
|
||||
SisterWeapon->Destroy();
|
||||
sister->SisterWeapon = NULL;
|
||||
if (sister != this)
|
||||
{ // In case we are our own sister, don't crash.
|
||||
sister->Destroy();
|
||||
}
|
||||
}
|
||||
Super::Destroy();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue