diff --git a/wadsrc/static/zscript/actors/inventory/inventory.zs b/wadsrc/static/zscript/actors/inventory/inventory.zs index 564989459..2e6544093 100644 --- a/wadsrc/static/zscript/actors/inventory/inventory.zs +++ b/wadsrc/static/zscript/actors/inventory/inventory.zs @@ -271,19 +271,18 @@ class Inventory : Actor if (bSharingItem) return; - class type = GetClass(); int skip = giver && giver.player ? giver.PlayerNumber() : -1; - for (int i; i < MAXPLAYERS; ++i) { if (!playerInGame[i] || i == skip) continue; - let item = Inventory(Spawn(type)); - if (!item) + let item = CreateLocalCopy(players[i].mo); + if (!item || item == self) continue; item.bSharingItem = true; + item.bDropped = item.bNeverLocal = true; if (!item.CallTryPickup(players[i].mo)) { item.Destroy(); @@ -293,14 +292,13 @@ class Inventory : Actor if (!bQuiet) { - PlayPickupSound(players[i].mo); + PrintPickupMessage(i == consoleplayer, item.PickupMessage()); + + item.PlayPickupSound(players[i].mo); if (!bNoScreenFlash && players[i].PlayerState != PST_DEAD) players[i].BonusCount = BONUSADD; } } - - if (!bQuiet && consoleplayer != skip) - PrintPickupMessage(true, PickupMessage()); } //=========================================================================== @@ -700,7 +698,7 @@ class Inventory : Actor toucher.HasReceived(self); // If the item can be shared, make sure every player gets a copy. - if (multiplayer && !deathmatch && ShouldShareItem(toucher)) + if (multiplayer && !deathmatch && !bDropped && ShouldShareItem(toucher)) ShareItemWithPlayers(toucher); } return res, toucher; @@ -869,13 +867,13 @@ class Inventory : Actor if (!bQuiet) { - PrintPickupMessage(localview, PickupMessage ()); + PrintPickupMessage(localview, give.PickupMessage ()); // Special check so voodoo dolls picking up items cause the // real player to make noise. if (player != NULL) { - PlayPickupSound (player.mo); + give.PlayPickupSound (player.mo); if (!bNoScreenFlash && player.playerstate != PST_DEAD) { player.bonuscount = BONUSADD; @@ -883,7 +881,7 @@ class Inventory : Actor } else { - PlayPickupSound (toucher); + give.PlayPickupSound (toucher); } } diff --git a/wadsrc/static/zscript/actors/player/player.zs b/wadsrc/static/zscript/actors/player/player.zs index fe56805d7..505d18d83 100644 --- a/wadsrc/static/zscript/actors/player/player.zs +++ b/wadsrc/static/zscript/actors/player/player.zs @@ -1945,6 +1945,7 @@ class PlayerPawn : Actor { item = Inventory(Spawn(ti)); item.bIgnoreSkill = true; // no skill multipliers here + item.bDropped = item.bNeverLocal = true; // Avoid possible copies. item.Amount = di.Amount; let weap = Weapon(item); if (weap)