- 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:
Randy Heit 2012-10-11 04:38:52 +00:00
parent 81ce8b28f2
commit f3b40a9f36

View file

@ -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;
} }
} }