mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 15:02:01 +00:00
- Fixed: WeaponGiver needs to set the MF_DROPPED flag of the spawned weapon to match its own (so
that it can't be used as an infinite source of ammo when sv_weaponstay is true). - Fixed: WeaponGiver should not remember the given weapon after it is picked up (to avoid giving a weapon owned by one player to a different player when sv_weaponstay is true). SVN r3886 (trunk)
This commit is contained in:
parent
81ce8b28f2
commit
f3b40a9f36
1 changed files with 6 additions and 1 deletions
|
@ -727,6 +727,7 @@ bool AWeaponGiver::TryPickup(AActor *&toucher)
|
||||||
if (weap != NULL)
|
if (weap != NULL)
|
||||||
{
|
{
|
||||||
weap->ItemFlags &= ~IF_ALWAYSPICKUP; // use the flag of this item only.
|
weap->ItemFlags &= ~IF_ALWAYSPICKUP; // use the flag of this item only.
|
||||||
|
weap->flags = (weap->flags & ~MF_DROPPED) | (this->flags & MF_DROPPED);
|
||||||
if (AmmoGive1 >= 0) weap->AmmoGive1 = AmmoGive1;
|
if (AmmoGive1 >= 0) weap->AmmoGive1 = AmmoGive1;
|
||||||
if (AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2;
|
if (AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2;
|
||||||
weap->BecomeItem();
|
weap->BecomeItem();
|
||||||
|
@ -736,7 +737,11 @@ bool AWeaponGiver::TryPickup(AActor *&toucher)
|
||||||
|
|
||||||
weap = barrier_cast<AWeapon*>(master);
|
weap = barrier_cast<AWeapon*>(master);
|
||||||
bool res = weap->CallTryPickup(toucher);
|
bool res = weap->CallTryPickup(toucher);
|
||||||
if (res) GoAwayAndDie();
|
if (res)
|
||||||
|
{
|
||||||
|
GoAwayAndDie();
|
||||||
|
master = NULL;
|
||||||
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue