From f3b40a9f3630cde5ddadad23bd8d6478d228cbcb Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 11 Oct 2012 04:38:52 +0000 Subject: [PATCH] - 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) --- src/g_shared/a_weapons.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/g_shared/a_weapons.cpp b/src/g_shared/a_weapons.cpp index a59e8f564f..c5035e416a 100644 --- a/src/g_shared/a_weapons.cpp +++ b/src/g_shared/a_weapons.cpp @@ -727,6 +727,7 @@ bool AWeaponGiver::TryPickup(AActor *&toucher) if (weap != NULL) { 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 (AmmoGive2 >= 0) weap->AmmoGive2 = AmmoGive2; weap->BecomeItem(); @@ -736,7 +737,11 @@ bool AWeaponGiver::TryPickup(AActor *&toucher) weap = barrier_cast(master); bool res = weap->CallTryPickup(toucher); - if (res) GoAwayAndDie(); + if (res) + { + GoAwayAndDie(); + master = NULL; + } return res; } }